问题
Since Spotify changed to their latest version the old Play/Pause through ControlSend, ahk_parent, {space}, ahk_class SpotifyMainWindow
stopped working.
It seems Spotify can now capture the Media keys and as suggested by other members the following works:
^Space::Media_Play_Pause
HOWEVER mapping to the Pause key doesn't work.
Pause::Media_Play_Pause
Any idea why???
FYI here is the scan of the keys:
Working (^Space):
VK SC Type Up/Dn Elapsed Key Window
----------------------------------------------
A2 01D d 1.61 LControl
20 039 h d 0.14 Space
B3 022 i d 0.00 Media_Play_Pause
20 039 h u 0.13 Space
B3 022 i u 0.00 Media_Play_Pause
A2 01D u 0.13 LControl
Not working (Pause):
13 045 h d 1.81 Pause
B3 022 i d 0.00 Media_Play_Pause
13 045 h u 0.16 Pause
B3 022 i u 0.00 Media_Play_Pause
Another intriguing point is that neither of the following Send commands work:
Send {VKB3SC022}
Send {Media_Play_Pause}
回答1:
I notice that for media_play_pause, the UpDn column is 0.00
Does this not mean that the key is not being "Held" for any time?
Try either:
Send {media_play_pause down}
Sleep 50
Send {media_play_pause up}
Or:
SetKeyDelay, 0, 50
[...]
Send {media_play_pause}
It is also worth trying the other usual culprit - run the script as administrator.
来源:https://stackoverflow.com/questions/29127315/autohotkey-media-play-pause-not-mapped-to-pause-but-mapped-to-space