#Requires AutoHotkey v2 #SingleInstance Force SetCapsLockState("AlwaysOff") global move := 1 /* This program only works if it is run as admin. If it knows that it isn't, it will ask you to elevate it. Declining will make it crash. Capslock is disabled when this program is running, not that you should miss it. Hold the capslock key to use these hotkeys: W, A, S and D accelerate the mouse These can be pressed or held, functioning as a normal mouse button would: Q is a left click E is a right click 2 is a middle click These are toggled, but can be held to simulate a makeshift autoclicker: 1 is a held left click 3 is a held right click x is a held middle click These scroll the page, though you can't zoom in: Arrow keys scroll self-explanitory R scrolls up F scrolls down Z scrolls left C scrolls right These zoom in or out: G zooms in V zooms out These controls may look confusing, but they make sense relative to each other. The only issue is key rollover, meaning your computer may not like you holding down multiple keys. This tool should be an alternative to using a different method, not as a pure substitute. */ ; Self-elevates if !A_IsAdmin { ; If it's not currently run as administrator: Run('*RunAs "' A_ScriptFullPath '"') ; Attempt to reopen as administrator } ; Gets closed if it opens another instance with administrator, crashes if it fails else { ; If this instance IS administrator (usually the self-opened instance): TrayTip("Started") ; Show a little notification to confirm it worked... Sleep(3000) ; ... let it show for a bit... TrayTip() ; ... then remove it } ; Doesn't crash or get closed, meaning it can continue the code. ; For the Q, 2 and E keys to simulate normal mouse buttons: CapsLock & q:: { ; When pressed: if !GetKeyState("LButton") { ; If it hasn't already clicked: Send("{LButton Down}") ; Press down the mouse button... } } CapsLock & q Up:: Send("{LButton Up}") ; ... and release it once you do CapsLock & 2:: { if !GetKeyState("MButton") { Send("{MButton Down}") } } CapsLock & 2 Up:: Send("{MButton Up}") CapsLock & e:: { if !GetKeyState("RButton") { Send("{RButton Down}") } } CapsLock & e Up:: Send("{RButton Up}") ; For the 1, X and 3 keys to simulate holding down a mouse button: CapsLock & 1:: { ; When pressed any time: if !GetKeyState("LButton") { ; If it hasn't started holding the button: Send("{LButton Down}") ; Start holding the button } ; Otherwise (if it previously started holding the button): else Send("{LButton Up}") ; Stop holding the button } CapsLock & x:: { if !GetKeyState("MButton") { Send("{MButton Down}") } else Send("{MButton Up}") } CapsLock & 3:: { if !GetKeyState("RButton") { Send("{RButton Down}") } else Send("{RButton Up}") } ; For the W, A, S and D keys to move the mouse respectively: CapsLock & w:: { ; When first pressed: while GetKeyState("w", "P"){ ; Loop this while it is still being held: global move ; Get the movement variable MouseMove(0, -move, 0, "R") ; Move the mouse var distance through X, Y, Speed (instant), Relative move++ ; Increase the var to make it faster for long distances while otherwise precise for short distances Sleep(50) ; Since this is a single loop, delay a bit so it doesn't teleport } ; After it stops being held: move := 1 ; Reset the movement speed var } CapsLock & s:: { while GetKeyState("s", "P"){ global move MouseMove(0, move, 0, "R") move++ Sleep(50) } move := 1 } CapsLock & a:: { while GetKeyState("a", "P"){ global move MouseMove(-move, 0, 0, "R") move++ Sleep(50) } move := 1 } CapsLock & d:: { while GetKeyState("d", "P"){ global move MouseMove(move, 0, 0, "R") move++ Sleep(50) } move := 1 } ; For the arrow keys respectively and the other keys, all individually, to scroll: CapsLock & Up:: { ; When pressed: Send("{WheelUp}") ; Scroll } CapsLock & Down:: { Send("{WheelDown}") } CapsLock & Left:: { Send("{WheelLeft}") } CapsLock & Right:: { Send("{WheelRight}") } CapsLock & r:: { Send("{WheelUp}") } CapsLock & f:: { Send("{WheelDown}") } CapsLock & z:: { Send("{WheelLeft}") } CapsLock & c:: { Send("{WheelRight}") } ; For the G and V keys to control zooming: CapsLock & g:: { ; When pressed: Send("^{WheelUp}") ; Use CTRL + Scroll to zoom in most things } CapsLock & v:: { Send("^{WheelDown}") }