自定义Chrome开发人员工具JavaScriptdebugging器键盘快捷键?

我不能相信,谷歌或search引擎search都没有给出明确的答案或甚至是很多的讨论,但是:

是否可以在Google Chrome JavaScriptdebugging器中编辑/自定义键盘快捷键? 如果是的话,怎么样?

我已经习惯了Eclipse的F5 / F6 / F7 / F8debugging器步入/结束/结束/恢复键,并且需要Google Chrome中的相同绑定。 F10 / F11是OSX的默认曝光键,因此不适合debugging器控制。

我打开非正统的解决scheme,例如Quicksilver / AppleScript。

相关但不是很有帮助的页面:

  • Google Chrome的Javascript控制台键盘快捷键
  • Chrome键盘快捷键文档

有关:

Addy已经开始了一个问题“能够为DevTools定制键盘快捷键/键绑定”: https : //code.google.com/p/chromium/issues/detail? id = 174309

Chrome快捷键pipe理器没有为我工作,但使用KeyRemap4MacBook做。 更多细节在这里: 谷歌Chrome开发者工具键盘快捷方式定制在Mac上

我用Karabiner做了这个。 我正在使用全尺寸键盘( F1F19键),所以我将它们映射到F13F16 。 通过这种方式,按键的布局与Chrome中button的布局相匹配。 键盘映射文件:

 <?xml version="1.0"?> <root> <appdef> <appname>CHROME</appname> <equal>com.google.Chrome</equal> </appdef> <item> <name>CHROMEDEBUGGINGKEY</name> <appendix>This maps the F13-F16 keys to Chrome debugging keys</appendix> <identifier>private.swap_chrome_to_debug_settings</identifier> <only>CHROME</only> <!--<autogen>__KeyToKey__ KeyCode::SPACE, KeyCode::TAB</autogen>--> <autogen> __KeyToKey__ KeyCode::F13, KeyCode::F8 </autogen> <autogen> __KeyToKey__ KeyCode::F14, KeyCode::F10 </autogen> <autogen> __KeyToKey__ KeyCode::F15, KeyCode::SEMICOLON, ModifierFlag::COMMAND_L </autogen> <autogen> __KeyToKey__ KeyCode::F16, KeyCode::SEMICOLON, ModifierFlag::COMMAND_L, ModifierFlag::SHIFT_L, </autogen> </item> </root> 

受@ jcollum回答的启发,这里还有另一个Karabiner private.xml定义,这个定义在原始问题中实现了特定的Eclipse键绑定。 请参阅在apple.stackexchange.com上切换答案的快捷键 。

 <?xml version="1.0"?> <root> <item> <name>Custom via private.xml</name> <appdef> <appname>ChromeLike</appname> <equal>com.google.Chrome</equal> <equal>com.vivaldi.Vivaldi</equal> <prefix>org.epichrome.app.</prefix> </appdef> <item> <name>Remap debugger keys in Chrome (Eclipse)</name> <appendix>Change consumer keys to function keys matching Eclipse shortcuts</appendix> <identifier>private.app_chromelike_switch_consumer_to_eclipse_debugger</identifier> <only>ChromeLike</only> <autogen>__KeyToKey__ ConsumerKeyCode::KEYBOARDLIGHT_LOW, ModifierFlag::NONE, KeyCode::F11</autogen> <!-- F5 Step Into --> <autogen>__KeyToKey__ ConsumerKeyCode::KEYBOARDLIGHT_HIGH, ModifierFlag::NONE, KeyCode::F10</autogen> <!-- F6 Step Over --> <autogen>__KeyToKey__ ConsumerKeyCode::MUSIC_PREV, ModifierFlag::NONE, KeyCode::F11, ModifierFlag::SHIFT_L</autogen> <!-- F7 Step Out --> <autogen>__KeyToKey__ ConsumerKeyCode::MUSIC_PLAY, ModifierFlag::NONE, KeyCode::F8</autogen> <!-- F8 Resume --> </item> </item> </root> 

受@ jcollum的回答启发,这是另一个Karabiner private.xml定义。 这个模仿我的IntelliJ键绑定。 请参阅在apple.stackexchange.com上切换答案的快捷键 。

 <?xml version="1.0"?> <root> <item> <name>Custom via private.xml</name> <appdef> <appname>ChromeLike</appname> <equal>com.google.Chrome</equal> <equal>com.vivaldi.Vivaldi</equal> <prefix>org.epichrome.app.</prefix> </appdef> <item> <name>Remap debugger keys in Chrome (IntelliJ)</name> <appendix>Change consumer keys to function keys matching IntelliJ shortcuts</appendix> <identifier>private.app_chromelike_switch_consumer_to_intellij_debugger</identifier> <only>ChromeLike</only> <autogen>__KeyToKey__ ConsumerKeyCode::MUSIC_PREV, ModifierFlag::NONE, KeyCode::F11</autogen> <!-- F7 Step Into --> <autogen>__KeyToKey__ ConsumerKeyCode::MUSIC_PLAY, ModifierFlag::NONE, KeyCode::F10</autogen> <!-- F8 Step Over --> <autogen>__KeyToKey__ ConsumerKeyCode::MUSIC_PLAY, ModifierFlag::SHIFT_L, KeyCode::F11, ModifierFlag::SHIFT_L</autogen> <!-- S-F8 Step Out --> <autogen>__KeyToKey__ ConsumerKeyCode::KEYBOARDLIGHT_HIGH, ModifierFlag::NONE, KeyCode::F11, ModifierFlag::SHIFT_L</autogen> <!-- F6 Step Out --> <autogen>__KeyToKey__ ConsumerKeyCode::MUSIC_NEXT, ModifierFlag::NONE, KeyCode::F8</autogen> <!-- F9 Resume --> </item> </item> </root> 

每个操作系统都有一些关键映射器,可以覆盖默认的组合键; 这里有几个:

  • 视窗
    • needle。
    • AutoHotkey的
  • OSX
    • 的xtype
  • Linux的
    • 自动密钥

分叉并扩展Chrome快捷方式pipe理器以实现本机function。

参考

  • needle。

  • AutoHotkey的

  • 的xtype

  • 自动密钥

  • Chrome快捷方式pipe理器

唯一对我有用的是在操作系统级别禁用快捷方式(或将其更改为其他内容)。

在OSX中,您可以转到System Preferences > keyboard > Keyboard Shortcuts并更改/禁用您需要在Chrome中工作的快捷键。

如果有人使用Ubuntu,设置全局快捷方式可能是目前最好的解决scheme。 以下是对我有用的东西:

  1. 安装xcape( https://github.com/alols/xcape )。 对于基于Debian的系统,您可以运行:

     sudo apt-get install git gcc make pkg-config libx11-dev libxtst-dev libxi-dev git clone https://github.com/alols/xcape.git cd xcape make sudo make install 
  2. 运行以下命令来映射前。 F6到开发工具的快捷方式:

     xcape -e 'F6=Control_L|Shift_L|I' 
  3. 设置你喜欢的快捷方式,并把你的.bash_profile的相关命令作为永久结果