【问题标题】:Cannot capture media key press无法捕获媒体按键
【发布时间】:2015-10-15 05:51:41
【问题描述】:

我正在尝试编写一个涉及我的键盘媒体键的 Auto HotKey 脚本,但是诸如 Media_Play_Pause 之类的按键似乎与我的媒体键不对应。

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

想法?

【问题讨论】:

    标签: google-chrome windows-7 autohotkey logitech media-keys


    【解决方案1】:

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

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

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

    1. 打开 C:\Program Files\Logitech\SetPointP\players.ini

    2. 将这些行添加到各自的部分

    [玩家]

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

    [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 音乐

    1. 重新启动您的 PC - 或 - 通过任务管理器终止“Logitech SetPoint Event Manager”,然后从“开始”菜单或控制面板重新打开 Logitech SetPoint 软件设置

    【讨论】:

      【解决方案2】:

      该脚本似乎已被弃用,不是它本身的代码,而是它的功能。我立即想到的是 Pandora 已经在网站上添加了快捷键,不再需要你在控件上进行选项卡。 Space 将激活播放/暂停,右箭头是下一首歌曲,等等。从该脚本中找到特殊键值(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}
      

      【讨论】:

      • 很遗憾,我并没有试图专门控制 Pandora。我只是想确定为什么 Auto HotKey 和 Chrome 无法识别我的媒体密钥,而其他应用程序却可以。
      • 我假设您已将 Chrome 和 AHK 更新到最新版本?
      • 确实有。我怀疑我的键盘没有像大多数人那样发送媒体按键,这是我试图通过使用 AHK 按键记录脚本来确认的。但我非常没有想法。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-03-24
      • 2013-12-22
      • 1970-01-01
      • 1970-01-01
      • 2013-04-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多