autohotkey Media_Play_Pause未映射为暂停,而是映射为^ Space [英] autohotkey Media_Play_Pause not mapped to Pause but mapped to ^Space

查看:339
本文介绍了autohotkey Media_Play_Pause未映射为暂停,而是映射为^ Space的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于Spotify更改为最新版本,因此通过ControlSend, ahk_parent, {space}, ahk_class SpotifyMainWindow进行的旧播放/暂停已停止.

Since Spotify changed to their latest version the old Play/Pause through ControlSend, ahk_parent, {space}, ahk_class SpotifyMainWindow stopped working.

Spotify现在可以捕获媒体密钥,并且可以按照其他成员的建议进行以下工作:

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

知道为什么吗?

仅供参考,这里是按键的扫描:

FYI here is the scan of the keys:

工作(^ Space):

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 

不起作用(暂停):

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}

推荐答案

我注意到,对于media_play_pause,UpDn列为0.00
这是否意味着该密钥在任何时候都不会被锁定"?
尝试以下任一方法:

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}

或者:

SetKeyDelay, 0, 50
[...]
Send {media_play_pause}

还值得尝试另一个常见的罪魁祸首-以管理员身份运行脚本.

It is also worth trying the other usual culprit - run the script as administrator.

这篇关于autohotkey Media_Play_Pause未映射为暂停,而是映射为^ Space的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆