无法捕获媒体按键

Cannot capture media key press

我正在尝试编写一个涉及我键盘媒体键的自动热键脚本,但是 Media_Play_Pause 等按键似乎与我的媒体键不对应。

虽然我的键盘 (Logitech Wireless K360) 上的媒体键可以在媒体应用程序上使用(在 iTunes、Spotify、VLC、WMP 上测试过),但我无法捕捉到新闻。当我在此 post https://superuser.com/questions/368633/play-pause-pandora-com-with-a-media-key 中使用自动热键脚本时或当我在 Google Chrome 中的键盘快捷键设置中时,没有任何显示。

想法?

该脚本似乎已被弃用,不是它本身的代码,而是它的功能。我立即想到的是 Pandora 已将快捷键添加到该站点,不再需要您在控件上切换。 Space 将激活 Play/Pause、向右箭头是下一首歌曲等。该脚本中查找特殊键值(SCXXX 部分)的说明仍然有效,您可以使用该分配函数的其余部分键。下面是一个使用来自 www.ahkscript.org

的最新版本的 AutoHotkey 的工作示例
; SC122 is Media_Play_Pause 

#If WinActive("Pandora Internet Radio") And WinExist(ahk_class Chrome_WidgetWin_1)
SC122::Send, {Space}

如果您访问 SetPoint 中的 'players.ini' 文件,您实际上可以将不同的程序和应用程序添加到 Set Point 的功能中。

Steinerd.com、http://steinerd.com/developments/hacks/media-keys/ 是我能找到的最全面的解释。

TL:DR(来自 https://gist.github.com/julianxhokaxhiu/f5ea4bb922e3ab1d7fec

  1. Open C:\Program Files\Logitech\SetPointP\players.ini

  2. Add these lines to their respective sections

[Players]

GooglePlayMusic=key,chrome.exe,Chrome_WidgetWin_1,xxx,xxx,&0xB3,&0xB3,&0xB2,&0xB1,&0xB0,0,1,Google Play Music

[Players.Run]

GooglePlayMusic=path,%USERPROFILE%\AppData\Local\Google\Chrome\User Data\Default\Web Applications_crx_icppfcnhkcmnfdhfhphakoifcfokfdhg\Google Play Music.ico

[Players.Display]

GooglePlayMusic=Google Play Music

  1. Restart your PC - OR - Kill 'Logitech SetPoint Event Manager' via Task manager and reopen the Logitech Setpoint software settings from Start menu or Control Panel