Advertisement
Guest User

Toggle key press

a guest
Jun 17th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #SingleInstance force ; Don't have multiple instances of this script running.
  2. SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
  3.  
  4. KeyDown = 0 ; variable to track the toggle state
  5.  
  6. ^F4:: ; Ctrl+F4 to start
  7.     KeyDown := !KeyDown ; Toggle states
  8.     If KeyDown
  9.         SendInput {w down} ; Hold down the key the first time you press the key combination
  10.     Else
  11.         SendInput {w up} ; Release the key
  12. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement