Skip to content

Instantly share code, notes, and snippets.

@tmk
Created February 8, 2013 12:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tmk/4738892 to your computer and use it in GitHub Desktop.
Save tmk/4738892 to your computer and use it in GitHub Desktop.
mousekey.ahk - lame mousekey without acceleration.
;
; Mousekeys layer: with ';'
;
; ,-----------------------------------------------------------.
; | `| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| Del |
; |-----------------------------------------------------------|
; | | | | | | |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 -100, 0, 0, R
else if GetKeyState("LShift", "P")
MouseMove -5, 0, 0, R
else
MouseMove -15, 0, 0, R
return
SC027 & j::
if GetKeyState("LControl", "P")
MouseMove 0, 100, 0, R
else if GetKeyState("LShift", "P")
MouseMove 0, 5, 0, R
else
MouseMove 0, 15, 0, R
return
SC027 & k::
if GetKeyState("LControl", "P")
MouseMove 0, -100, 0, R
else if GetKeyState("LShift", "P")
MouseMove 0, -5, 0, R
else
MouseMove 0, -15, 0, R
return
SC027 & l::
if GetKeyState("LControl", "P")
MouseMove 100, 0, 0, R
else if GetKeyState("LShift", "P")
MouseMove 5, 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
SC027 & SC029:: Send {Blind}{RShift up}{SC029} ; `
SC027 & 1:: Send {Blind}{RShift up}{F1}
SC027 & 2:: Send {Blind}{RShift up}{F2}
SC027 & 3:: Send {Blind}{RShift up}{F3}
SC027 & 4:: Send {Blind}{RShift up}{F4}
SC027 & 5:: Send {Blind}{RShift up}{F5}
SC027 & 6:: Send {Blind}{RShift up}{F6}
SC027 & 7:: Send {Blind}{RShift up}{F7}
SC027 & 8:: Send {Blind}{RShift up}{F8}
SC027 & 9:: Send {Blind}{RShift up}{F9}
SC027 & 0:: Send {Blind}{RShift up}{F10}
SC027 & -:: Send {Blind}{RShift up}{F11}
SC027 & =:: Send {Blind}{RShift up}{F12}
SC027 & BackSpace::Send {Blind}{RShift up}{Delete}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment