Advertisement
tabnation

double tap hotkeys

Mar 1st, 2022
1,531
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. ;0xB0BAFE77 v1 AHK
  2. settitlematchmode, 2
  3.  
  4. #IfWinActive Chrome
  5. *~Tab::double_tap_tab() ; Hotkey that fires and runs a function
  6.  
  7. double_tap_tab() {
  8. Static last := 0 ; Permanent variable to track last press
  9.  
  10. If (A_TickCount - last < 500) ; Diff current tick from last tick. Has it been 500ms?
  11. {
  12. MsgBox working! ; If yes, run stuff
  13. last := 0 ; Then set last to 0. This prevents a triple tap from firing
  14. }
  15. Else
  16. {
  17. last := A_TickCount ; If it hasn't been 500ms, set last press to current tick
  18. }
  19. return
  20. }
  21. #IfWinActive
  22.  
  23.  
  24.  
  25.  
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement