Commit 182b3cdf authored by Albert Gräf's avatar Albert Gräf
Browse files

Preliminary fix for the "dsp on" (Ctrl+/) keybinding.

- Make the Ctrl+/ keybinding work on German keyboards. This actually adds a
  binding for the 7 key which has the / symbol on it as a shifted key on
  German keyboards. For some reason that key isn't properly mapped by nw.js,
  so we do it manually. We do this unconditionally, as there doesn't seem to
  be a portable way to check which keyboard is actually active.

- Add a secondary, more international-keyboard-friendly, Ctrl+, keybinding for
  the "dsp on" function. The comma works much better for this function on some
  European keyboards which have the / key on the first row of the keyboard, as
  it is next to the period on most European keyboards (the Latin ones at
  least). The intention here is to make it easy on a wider range of keyboards
  to quickly turn off dsp and then turn it on again using keyboard commands.
  The Ctrl+, keybinding should work well for that purpose with almost any
  Latin keyboard. But note that the Ctrl+/ keybinding remains to be available
  as well for backward compatibility.

NOTE: Right now these only work in canvas windows, we still need to add
something similar to the console windows to make it work there.
parent 4f367208
......@@ -396,6 +396,20 @@ var canvas_events = (function() {
case 16: hack = "Shift"; break;
case 17: hack = "Control"; break;
case 18: hack = "Alt"; break;
// keycode 188 = comma -- in contrast to / this is
// next to the period on most Latin keyboards, so
// much more convenient to quickly switch dsp off
// and then on again
case 188:
// keycode 55 = 7 key (shifted = '/' on German keyboards)
case 55:
if (cmd_or_ctrl_key(evt)) {
pdgui.pdsend("pd dsp 1");
if (hack !== null) {
pdgui.canvas_sendkey(name, 1, evt, hack, keydown_autorepeat);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment