cagefighter3131

META RIGHT BUTTON

Nov 22nd, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; ---------
  2. ; META RIGHT BUTTON
  3. ; ------
  4. ; For Internet Browsers
  5. ; ---
  6. ; - Single RClick: New tab
  7. ; - Double RClick: Close tab
  8. ; - Hold down half second: Exit app
  9. ; - Shift RClick: Right click
  10. ; ---
  11. ; For Others
  12. ; ---
  13. ; - Single RClick: New window
  14. ; - Double RClick: Close tab
  15. ; - Hold down half second: Exit app
  16. ; - Shift RClick: Right click
  17. ; ---
  18. ; Toggle disable: Windows + RButton
  19. ; Source: ;https://autohotkey.com/board/topic/7648-right-mouse-button-added-functionality-doubleclick-it/
  20.  
  21. RButton::
  22.     KeyWait, RButton, t0.5
  23.     if errorlevel ; Hold down for half a second
  24.         Send, !{f4}
  25.     else
  26.         KeyWait, RButton, d, t0.5
  27.     if !errorlevel ; Double right click
  28.     {
  29.         IfWinActive, ahk_class Notepad
  30.             Send, !{f4} ; Winclose, a
  31.         else
  32.             Send, ^w ; ^{f4}
  33.     }
  34.     else ; Single right click
  35.     {
  36.         IfWinActive, ahk_class Chrome_WidgetWin_1
  37.             Send, ^t
  38.         else
  39.             Send, ^n
  40.     }
  41. return
Add Comment
Please, Sign In to add comment