Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
- SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
- SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
- #Persistent ; Keep this script running until the user explicitly exits it.
- SetTimer, WatchPOV, 5
- return
- WatchPOV:
- GetKeyState, POV, JoyPOV
- KeyToHoldDownPrev = %KeyToHoldDown%
- if POV = -1
- KeyToHoldDown = Numpad5
- else if POV = 0
- KeyToHoldDown = Numpad8
- else if POV = 4500
- KeyToHoldDown = Numpad9
- else if POV = 9000
- KeyToHoldDown = Numpad6
- else if POV = 13500
- KeyToHoldDown = Numpad3
- else if POV = 18000
- KeyToHoldDown = Numpad2
- else if POV = 22500
- KeyToHoldDown = Numpad1
- else if POV = 27000
- KeyToHoldDown = Numpad4
- else if POV = 31500
- KeyToHoldDown = Numpad7
- if KeyToHoldDown = %KeyToHoldDownPrev%
- return
- else
- ;msgbox %KeyToHoldDown%
- ;SetKeyDelay -1
- if KeyToHoldDownPrev <> ""
- Send, {%KeyToHoldDownPrev% up}
- Send, {%KeyToHoldDown% down}
- Send, {%KeyToHoldDown% up}
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement