Code: Select all
; ********************************* (using only the mouse to go forward/backward on youtube) + (enable/disable all youtube hotkeys with a single hotkey)
SetTitleMatchMode, Regex
toggle := 0
youtubesetting(toggle){
;|This will only go off if toggle is true/1
; it will be activated only on youtube (but dactivativated anywhere)
#If WinActive("YouTube") ; pb: i=you can't desactivated it unless you are on YouTube...
If (toggle==1){
TrayTip, ON, Youtube mode activated,,1
Hotkey,WheelUp,WheelUpfunction,On
Hotkey,WheelDown,WheelDownf,On
WheelUpfunction:
Send, {Right}
return
WheelDownf:
Send, {Left}
return
}
If (toggle==0){
TrayTip, OFF, Youtube mode disactivated,,1
; if toogle is OFF: set the button to their original use
Hotkey,WheelUp,WheelUpfunctionBack,On
Hotkey,WheelDown,WheelDownfunctionBack,On
WheelUpfunctionBack:
Send, {WheelUp}
return
WheelDownfunctionBack:
Send, {WheelDown}
return
}
}
~LButton & RButton::
; tilde: that hotkey will fire when the key is pressed instead of being delayed until the key is released
;|This will change the toggle var to the inverse of what it's original value is (0 = 1 and 1 = 0 || true = false and false = true)
toggle := !toggle
youtubesetting(toggle)
return
#if