autohotkey Media_Play_Pause not mapped to Pause but mapped to ^Space

拜拜、爱过 提交于 2019-12-13 01:08:32

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!