How to use multimedia keys on Komodo?

I have a lot of keybinding for too many commands and scripts, I am looking for options to avoid long shortcuts like Ctrl+Alt+Shift+F4 or Ctrl+K, C, L, E, A, R (yes, I am using that sequence), so I am thinking on use the multimedia keys for debugging, lest say something like:

  • Play for Go/Continue debugging
  • Stop for stop debugging
  • Pause for… well… pause debugging
  • Fwd for runs to the end or next breakpoint

I tried assigned them but seems like komodo doesn’t listen these keys, so…

Is there any way to use these multimedia keys on komodo?

Thank you!

This is a great question. I’ve never dug into that part of Komodo before. Looks like we can hack this in if you like though.

So this will add the appropriate keys to your prefs:

var _ = require("contrib/underscore");

var VKLabels = { "Volume_Down":"VK_VOLUME_DOWN",

var VKCodes = {0xB6: "Volume_Down",
0xB7: "Volume_Up",
0xB5: "Volume_Mute"};

_.extend(ko.keybindings.VKLabels, VKLabels);
_.extend(ko.keybindings.VKCodes, VKCodes);

Running that in a Userscript at start up would add them or you can copy/paste run it in the JS Console (View menu > Tabs & Sidebars > Console). Once you run the above, you SHOULD be able to hit the named keys in the keybindings prefs window, in the New Key Sequence field. I couldn’t figure out the play button as it didn’t seem to use a proper standard key on my keyboard.

I considered adding this to Komodo core but I don’t have time to test that it works on Linux, OSX and Windows, plus confirm that other keyboards don’t use other names/values (they shouldn’t…).

I figured this out by adding a few console.log() lines to, if you feel like muck around more.

  • Carey

Where can I find that keybindings.p.js file to try to find the play key?

I suggest you build Komodo from source to play with it’s insides. To edit the installed version can you clarify which platform you’re on?

Do you mean my operating system? I am on Windows 10.

Do you know any other way to get my media keys code?

reBuild komodo sounds risky, I don’t want to break anything :fearful:

Now that you mention it, yes, just put a onkeypress function on window:
window.onkeypress = console.log

  • Carey