Sublime Forum

Cannot create key bindings with the pipe-key on Norw. keyb

#1

Original question is here: superuser.com/questions/781816/c … in-sublime

I am trying to bind ctrl+| to Show Console in Sublime Text 2 on a Norwegian keyboard using the following line in the (json?) configuration file:

{ "keys": "ctrl+|"], "command": "show_panel", "args": {"panel": "console", "toggle": true} },

This doesn’t work, and the pipe symbol also has a slightly darker tint than the rest of the configuration text, as if it is special.

I tried to escape it using “ctrl+|” and “ctrl+\|” none of which work. Binding it to something else like “ctrl+p” works fine.

Any idea of how to bind functionality with the pipe-key? It’s the top left key on the keyboard, left to the 1 key:

0 Likes

#2

Hi,

What’s printed on a key is not neccessarily what should be used for binding.

In the console window, enter the following command:

sublime.log_input(True)

Then, all recognized keypresses will be displayed as you enter them. Hence, simply press your desired binding and, if bindable, its name will be displayed.

Here on a French keyboard, the label is ², but the binding is control+’

Hope this helps,

Martin

0 Likes

#3

Thank you so much mlf. It worked!

I opened the console window manually and applied

sublime.log_input(True)

then hit “ctrl+|”. This produced the following output:

chr evt: FS (0x1c)

In the output above I replaced the the actual character, the File Separator symbol, with the text FS. I copied the character into the keybinding config file and voila! It now worked.

Here is the same discussion over at superuser on the stackexchange network: superuser.com/questions/781816/c … in-sublime

Again, thank you.

0 Likes