Skip to content

Instantly share code, notes, and snippets.

@ViViDboarder
Created December 31, 2012 14:35
Show Gist options
  • Save ViViDboarder/4420198 to your computer and use it in GitHub Desktop.
Save ViViDboarder/4420198 to your computer and use it in GitHub Desktop.
Modified HHKB Pro AHK with Dip Switch Emulation Definitely a work in progress
; HHKB Pro2 emulation by AndrewZorn
; for use with QWERTY
; with DIP in position 011100
; (Mac Mode, Backspace, Left Fn)
;
; inspired by and based on ripster's
;
; Modified with Dip Switches by ViViDboarder
;
; "Inser" becomes `/~ because Backspace is too big
; "Right Ctrl" becomes Fn
; this is for ANSI keyboard
;
; Initial Layout:
; LCtrl > Nothing
; Meta > Alt
; RightClick > Nothing
; RCtrl > Fn
Use_Switches=TRUE
IF (%Use_Switches%) {
; EDIT THESE
Sw1=0
Sw2=1
Sw3=1
Sw4=1
Sw5=0
Sw6=0
; Set the properties
S_HHKB = (Sw1==0 && Sw2==0)
S_Lite = (Sw1==1 && Sw2==0)
S_Mac = (Sw1==0 && Sw2==1)
S_NA = (Sw1==1 && Sw2==1)
S_DelBs = (Sw3==1)
S_MetaFn = (Sw4==1)
S_SwAltMeta = (Sw5==1)
S_WakeUp = (Sw6==1)
} else {
; EDIT THESE
S_HHKB = TRUE
S_Lite = FALSE
S_Mac = FALSE
S_NA = FALSE
S_DelBs = FALSE
S_MetaFn = FALSE
S_SwAltMeta = FALSE
S_WakeUp = FALSE
}
#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%
SC029::Esc
CapsLock::LCtrl
if (S_DelBs) {
\::Backspace
} else {
\::Del
}
Backspace::\
Insert::`
; Kill Control keys
LCtrl::Send {nothinglol}
RCtrl::Send {nothinglol}
AppsKey::Send {nothinglol}
; Fix Alt/<> keys
if (S_SwAltMeta == FALSE) {
LWin::Alt
RWin::RAlt
LAlt::LWin
RAlt::RWin
}
; For the sake of accuracy
SC15D::Send {nothinglol}
if (S_MetaFn && !S_SwAltMeta) {
; Left Fn key (why does everything need Send{}?)
LAlt & 1::Send {F1}
LAlt & 2::Send {F2}
LAlt & 3::Send {F3}
LAlt & 4::Send {F4}
LAlt & 5::Send {F5}
LAlt & 6::Send {F6}
LAlt & 7::Send {F7}
LAlt & 8::Send {F8}
LAlt & 9::Send {F9}
LAlt & 0::Send {F10}
LAlt & -::Send {F11}
LAlt & =::Send {F12}
LAlt & Backspace::Send {Insert} ; not sure Insert even works right on my HHKB
if (S_DelBs) {
LAlt & Insert::Send {Del}
} else {
LAlt & Insert::Send {Backspace}
}
LAlt & Tab::Send {CapsLock}
LAlt & h::Send {*}
LAlt & j::Send {/}
LAlt & n::Send {+}
LAlt & m::Send {-}
LAlt & k::Send {Home}
LAlt & ,::Send {End}
LAlt & l::Send {PgUp}
LAlt & .::Send {PgDn}
LAlt & [::Send {Up}
LAlt & SC027::Send {Left}
LAlt & '::Send {Right}
LAlt & /::Send {Down}
LAlt & i::Send {PrintScreen}
LAlt & o::Send {ScrollLock}
LAlt & p::Send {Pause}
} else if (S_MetaFn && S_SwAltMeta) {
; Left Fn key (why does everything need Send{}?)
LWin & 1::Send {F1}
LWin & 2::Send {F2}
LWin & 3::Send {F3}
LWin & 4::Send {F4}
LWin & 5::Send {F5}
LWin & 6::Send {F6}
LWin & 7::Send {F7}
LWin & 8::Send {F8}
LWin & 9::Send {F9}
LWin & 0::Send {F10}
LWin & -::Send {F11}
LWin & =::Send {F12}
LWin & Backspace::Send {Insert} ; not sure Insert even works right on my HHKB
if (S_DelBs) {
LWin & Insert::Send {Del}
} else {
LWin & Insert::Send {Backspace}
}
LWin & Tab::Send {CapsLock}
LWin & h::Send {*}
LWin & j::Send {/}
LWin & n::Send {+}
LWin & m::Send {-}
LWin & k::Send {Home}
LWin & ,::Send {End}
LWin & l::Send {PgUp}
LWin & .::Send {PgDn}
LWin & [::Send {Up}
LWin & SC027::Send {Left}
LWin & '::Send {Right}
LWin & /::Send {Down}
LWin & i::Send {PrintScreen}
LWin & o::Send {ScrollLock}
LWin & p::Send {Pause}
} else if (!S_MetaFn) {
; Right Fn key (REPEATED FROM ABOVE, notice I can't figure out custom modifiers)
RCtrl & 1::Send {F1}
RCtrl & 2::Send {F2}
RCtrl & 3::Send {F3}
RCtrl & 4::Send {F4}
RCtrl & 5::Send {F5}
RCtrl & 6::Send {F6}
RCtrl & 7::Send {F7}
RCtrl & 8::Send {F8}
RCtrl & 9::Send {F9}
RCtrl & 0::Send {F10}
RCtrl & -::Send {F11}
RCtrl & =::Send {F12}
RCtrl & Backspace::Send {Insert} ; not sure Insert even works right on my HHKB
if (S_DelBs) {
RCtrl & Insert::Send {Del}
} else {
RCtrl & Insert::Send {Backspace}
}
RCtrl & Tab::Send {CapsLock}
RCtrl & h::Send {*}
RCtrl & j::Send {/}
RCtrl & n::Send {+}
RCtrl & m::Send {-}
RCtrl & k::Send {Home}
RCtrl & ,::Send {End}
RCtrl & l::Send {PgUp}
RCtrl & .::Send {PgDn}
RCtrl & [::Send {Up}
RCtrl & SC027::Send {Left}
RCtrl & '::Send {Right}
RCtrl & /::Send {Down}
RCtrl & i::Send {PrintScreen}
RCtrl & o::Send {ScrollLock}
RCtrl & p::Send {Pause}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment