Ctrl - / not toggling comments in Firefox

I took a quick look at ways to map key codes to keyboard characters, and … oh boy.

What I’ve gathered so far for the “/” character:

  • There are two keycodes, 111 (numpad divide) and 191 (forward slash).
  • CodeMirror maps keycodes to key names.
  • All shortcuts in CodeMirror are defined through key names, e.g. “Cmd-/”.
  • The rules for key codes in browsers are incredibly complex (and inconsistent), and are the reason that entering “?” (shift-ß) on a German keyboard produces the keycode 191.

In short, I’m not sure if it’s actually feasible to document language-specific shortcuts.

1 Like