I have a short code, which opens with alt and p in windows explorer the preview pane on the right side and maps the space bar to an control click on the preview pane play button, so that I can play sound files without opening in a player. When I close the pane again with alt p, the control click unmaps from the space bar, so that it can send blank space again.
This is the code:
Code: Select all
#IfWinActive ahk_class CabinetWClass
~!p::
mode:= 1
sleep, 1000
while !(GetKeyState("p", "P") and GetKeyState("alt", "P"))
sleep, 50
mode:= 0
return
#If mode
Space::ControlClick,x1245 y565,A
#If
Is would like to use the space bar mapping only in windows explorer, I need the "if mode" only work in windows explorer, something like this:
Code: Select all
#If mode AND #IfWinActive ahk_class CabinetWClass
Space::ControlClick,x1245 y565,A
#If