Skip to content

Instantly share code, notes, and snippets.

@willwade
Last active January 11, 2022 19:59
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 willwade/c399997732c317b16c6fcdf6b61e7e3b to your computer and use it in GitHub Desktop.
Save willwade/c399997732c317b16c6fcdf6b61e7e3b to your computer and use it in GitHub Desktop.
Mouse2Keypress - This AHK Script recognises any movement (you can adjust the sensitivity) and then sends a space bar.
#persistent
coordmode, mouse, screen
mousegetpos, sx, sy
settimer, check, 250
return
check:
mousegetpos, cx, cy
if (cx != sx or cy != sy)
{
; mouse has moved, calculate by how much
if (cx > (sx+50) or cx < (sx-50) or cy > (sy+50) or cy < (sy-50))
{
Send {Space}
mousegetpos, sx, sy ; get new mouse position
}
}
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment