Skip to content

Instantly share code, notes, and snippets.

@pprince
Created December 21, 2015 01:58
Show Gist options
  • Save pprince/c79621445147c20b5f24 to your computer and use it in GitHub Desktop.
Save pprince/c79621445147c20b5f24 to your computer and use it in GitHub Desktop.
; =============== --------------------------------------------
; = MOUSE NUDGE = - by "Paul Prince" <paul@littlebluetech.com>
; =============== --------------------------------------------
;
; This is a very simple but /very/ useful AutoHotKey script. I made
; it originally to help me fine-tune my in-game UI for the WildStar
; MMO; after spending a few too many hours trying to line-up pixels
; using a high-DPI gaming mouse, I realized there was a better way.
;
; When NumLock is turned off, pressing the numberpad keys (1-9) will
; cause the mouse cursor to move exactly 1 pixel in the corresponding
; direction; left-click-and-hold is also simulated, so that you can
; use this tool to drag UI elements in perfect 1px increments.
;
; e.g., Numpad8 -> 1px up
; Numpad6 -> 1px right
; Numpad9 -> 1px up + 1px right
#Warn All
#UseHook on
*NumpadRight::
Mouse_RIGHT() {
MouseClickDrag Left, , , 1, 0, , R
}
*NumpadLeft::
Mouse_LEFT() {
MouseClickDrag Left, , , -1, 0, , R
}
*NumpadDown::
Mouse_DOWN() {
MouseClickDrag Left, , , 0, 1, , R
}
*NumpadUp::
Mouse_UP() {
MouseClickDrag Left, , , 0, -1, , R
}
*NumpadHome::
Mouse_LEFT()
Mouse_UP()
return
*NumpadEnd::
Mouse_LEFT()
Mouse_DOWN()
return
*NumpadPgDn::
Mouse_RIGHT()
Mouse_DOWN()
return
*NumpadPgUp::
Mouse_RIGHT()
Mouse_UP()
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment