Sublime Forum

Key bindings on a quertz keyboard

#1

I am testing st2 on a w8.1 machine with German quertz-keyboard. The default key bindings do not fit to the physical key positions. But changing to characters/keys of my layout does not work. E.g. { "keys": "ctrl+<"], "command": "toggle_comment", "args": { "block": false } }does not work. Either “ctrl+^” or “ctrl+#”

Not in Default or user key bindings.

0 Likes

#2

Use sublime.log_input(True) in the console and press some keys to see what Sublime Text understands.

Unfortunately it doesn’t work the other way around, so there is no way to find out which key(s) you need to press to trigger binding XY. You can only try and perhaps compile a list with the actual mappings.

0 Likes

#3

I prefere to overwrite the defaults with user-settings.
I’m using i.e. for toggle comment the following key-bindings:{ "keys": "ctrl+q"], "command": "toggle_comment", "args": { "block": false } }, { "keys": "ctrl+shift+q"], "command": "toggle_comment", "args": { "block": true } }

0 Likes

#4

The console tells me, that the char is (0x3c) = “<”, but my key binding doe not work. Another character (e.g. a letter) works, but not this "special ones, which are quit handy on my keyboard. :frowning:

0 Likes

#5

You can’t just use the single key, it has to be the key with the modifier. Press what would be ctrl+< on your keyboard and check the console again.

The reason for this is that char events are different from key events. Some key presses create both key and char events while some will only create either. ST has to handle them both. Letters usually only create char events while special character keys (that may be produced using one or multiple modifier keys) can create either both or only key events.

0 Likes