I got two Pokers the other day and can't get used to its cursor keys, Esc.
So, I wrote this AHK script that converts Poker(or other ANSI keyboards) into HHKB layout(and also offers mouse keys).
I sacrificed right shift for Fn key without pause 'cause I've never used right shift at all.
;
; HHKB layout, Cursor and Mouse keys
; This script converts ANSI keyboard into HHKB.
;
;
; HHKB layout
;
; ,-----------------------------------------------------------.
; |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|BackSpa|
; |-----------------------------------------------------------|
; |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]|BackS|
; |-----------------------------------------------------------|
; |Contro| A| S| D| F| G| H| J| K| L| ;| '| Return |
; |-----------------------------------------------------------|
; |Shift | Z| X| C| V| B| N| M| ,| .| /| |
; |-----------------------------------------------------------|
; |Contr|Win|Alt | Space |Alt | `| `| \|
; `-----------------------------------------------------------'
;
CapsLock:: Control
; ` to Esc
SC029:: Esc
RShift & SC029:: Send {Blind}{RShift up}{SC029} ; RShift + ` => `
Esc:: `
AppsKey:: `
RWin:: `
; \ to BackSpace
\:: BackSpace
RShift & \:: Send {Blind}{RShift up}{\} ; RShift + \ => \
RControl:: \
;
; HHKB Fn layer: with Right Shift
;
; ,-----------------------------------------------------------.
; | `| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| Del |
; |-----------------------------------------------------------|
; |Caps | | | | | | | |Psc|Slk|Pus|Up | | \|
; |-----------------------------------------------------------|
; |Contro|VoD|VoU|Mut| | | *| /|Hom|PgU|Lef|Rig| Return |
; |-----------------------------------------------------------|
; |Shift | | | | | | +| -|End|PgD|Dow| Fn|
; |-----------------------------------------------------------|
; |Contr|Win|Alt | Space |Alt | `| `| \|
; `-----------------------------------------------------------'
;
RShift & Tab:: Send {CapsLock}
RShift & a:: Send {Volume_Down}
RShift & s:: Send {Volume_Up}
RShift & d:: Send {Volume_Mute}
RShift & [:: Send {Blind}{RShift up}{Up}
RShift & SC027:: Send {Blind}{RShift up}{Left} ; semicolon ;
RShift & ':: Send {Blind}{RShift up}{Right}
RShift & SC035:: Send {Blind}{RShift up}{Down} ; slash /
RShift & l:: Send {Blind}{RShift up}{PgUp}
RShift & .:: Send {Blind}{RShift up}{PgDn}
RShift & k:: Send {Blind}{RShift up}{Home}
RShift & ,:: Send {Blind}{RShift up}{End}
RShift & i:: Send {Blind}{RShift up}{PrintScreen}
RShift & o:: Send {Blind}{RShift up}{ScrollLock}
RShift & p:: Send {Blind}{RShift up}{Pause}
RShift & 1:: Send {Blind}{RShift up}{F1}
RShift & 2:: Send {Blind}{RShift up}{F2}
RShift & 3:: Send {Blind}{RShift up}{F3}
RShift & 4:: Send {Blind}{RShift up}{F4}
RShift & 5:: Send {Blind}{RShift up}{F5}
RShift & 6:: Send {Blind}{RShift up}{F6}
RShift & 7:: Send {Blind}{RShift up}{F7}
RShift & 8:: Send {Blind}{RShift up}{F8}
RShift & 9:: Send {Blind}{RShift up}{F9}
RShift & 0:: Send {Blind}{RShift up}{F10}
RShift & -:: Send {Blind}{RShift up}{F11}
RShift & =:: Send {Blind}{RShift up}{F12}
RShift & BackSpace::Send {Blind}{RShift up}{Delete}
;RShift & Esc:: DllCall("PowrProf\SetSuspendState", "int", 0, "int", 0, "int", 0) ; suspend(sleep)
;RShift & a:: Send {vkAEsc12E} ; Vol Down
;RShift & s:: Send {vkAFsc130} ; Vol Up
;RShift & d:: Send {vkADsc120} ; Mute
;
; Cursorkeys layer: with '/'
;
; ,-----------------------------------------------------------.
; | | | | | | | | | | | | | | |
; |-----------------------------------------------------------|
; | | | | | | |Hom|PgD|PgUlEnd| | | | |
; |-----------------------------------------------------------|
; |Contro| | | | | |Lef|Dow|Up |Rig| | | |
; |-----------------------------------------------------------|
; |Shift | | | | | |Hom|PgD|PgUlEnd| Fn| |
; |-----------------------------------------------------------|
; |Contr|Win|Alt | Space |Alt | | | |
; `-----------------------------------------------------------'
;
*SC035:: Send {Blind}{SC035} ;
; cursor keys
SC035 & h:: Send {Blind}{Left}
SC035 & j:: Send {Blind}{Down}
SC035 & k:: Send {Blind}{Up}
SC035 & l:: Send {Blind}{Right}
SC035 & n:: Send {Blind}{Home}
SC035 & m:: Send {Blind}{PgDn}
SC035 & ,:: Send {Blind}{PgUp}
SC035 & .:: Send {Blind}{End}
SC035 & y:: Send {Blind}{Home}
SC035 & u:: Send {Blind}{PgDn}
SC035 & i:: Send {Blind}{PgUp}
SC035 & o:: Send {Blind}{End}
;
; Mousekeys layer: with ';'
;
; ,-----------------------------------------------------------.
; | `| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| |
; |-----------------------------------------------------------|
; | | | | | | |MwL|MwD|MwUlMwR| | | | |
; |-----------------------------------------------------------|
; |Contro| | | | | |McL|McD|McU|McR| Fn| | |
; |-----------------------------------------------------------|
; |Shift | | | | | |Mb2|Mb1| l | | |
; |-----------------------------------------------------------|
; |Contr|Win|Alt | Mb1 |Alt | | | |
; `-----------------------------------------------------------'
; Mw: mouse wheel / Mc: mouse cursor / Mb: mouse button
;
; mouse cursor:
; LShift: big step
; LControl: small step
;
*SC027:: Send {Blind}{SC027} ; semicolon
; mouse cursor
SC027 & h::
if GetKeyState("LControl", "P")
MouseMove -5, 0, 0,R
else if GetKeyState("LShift", "P")
MouseMove -100, 0, 0,R
else
MouseMove -15, 0, 0,R
return
SC027 & j::
if GetKeyState("LControl", "P")
MouseMove 0, 5, 0, R
else if GetKeyState("LShift", "P")
MouseMove 0, 100, 0, R
else
MouseMove 0, 15, 0, R
return
SC027 & k::
if GetKeyState("LControl", "P")
MouseMove 0, -5, 0, R
else if GetKeyState("LShift", "P")
MouseMove 0, -100, 0, R
else
MouseMove 0, -15, 0, R
return
SC027 & l::
if GetKeyState("LControl", "P")
MouseMove 5, 0, 0,R
else if GetKeyState("LShift", "P")
MouseMove 100, 0, 0,R
else
MouseMove 15, 0, 0,R
return
; mouse wheel
SC027 & y:: Send {WheelLeft}
SC027 & u:: Send {WheelDown}
SC027 & i:: Send {WheelUp}
SC027 & o:: Send {WheelRight}
; mouse button
SC027 & Space::
Send {Blind}{LButton down}
KeyWait Space ; Prevents repeating the mouse click.
Send {Blind}{LButton up}
return
SC027 & m::
Send {Blind}{LButton down}
KeyWait m ; Prevents repeating the mouse click.
Send {Blind}{LButton up}
return
SC027 & n::
Send {Blind}{RButton down}
KeyWait n ; Prevents repeating the mouse click.
Send {Blind}{RButton up}
return
; Functions
SC027 & SC029:: Send {Blind}{SC029} ; `
SC027 & 1:: Send {Blind}{F1}
SC027 & 2:: Send {Blind}{F2}
SC027 & 3:: Send {Blind}{F3}
SC027 & 4:: Send {Blind}{F4}
SC027 & 5:: Send {Blind}{F5}
SC027 & 6:: Send {Blind}{F6}
SC027 & 7:: Send {Blind}{F7}
SC027 & 8:: Send {Blind}{F8}
SC027 & 9:: Send {Blind}{F9}
SC027 & 0:: Send {Blind}{F10}
SC027 & -:: Send {Blind}{F11}
SC027 & +:: Send {Blind}{F12}
; Audio control
SC027 & a:: Send {Volume_Down}
SC027 & s:: Send {Volume_Up}
SC027 & d:: Send {Volume_Mute}