Vscode: Cannot type backslash on German keyboard in Editor

Created on 18 Jan 2017  Â·  8Comments  Â·  Source: microsoft/vscode

  • VSCode Version: 1.8.1
  • OS Version: Windows 10 Pro

Steps to Reproduce:

  1. Open a file with VSCode and focus in the file
  2. Press AltGr-ß (AltGr is the right alt key on German keyboards) which should produce a backslash
  3. Nothing happens
    (3a. Open Find dialog with F3, press AltGr-ß ->produces backslash like it should)
*question editor keybindings

Most helpful comment

German keyboard on Mac OS with GitLens installed: alt+shift+7 types a backslash, but is mapped to GitLens search history dialog. Just change the keyboard mapping.

All 8 comments

Most likely there is something bound to that key combination.

I know Atom had a similar bug at some time (https://github.com/atom/atom/issues/1625) but I don't know if VSCode and Atom share any code within the editor. But at least they have in common that Ctrl+Alt maps somewhat to AltGr. And Ctrl+ß maps to un-indenting while Ctrl+Shift+ß maps to code folding

To find out what a keybinding does:

  1. Open Preferences > Keyboard Shortcuts
  2. Click on Define Keybinding
  3. Press your desired key combination
    (e.g. doing it for Ctrl+Shift+1):
    image
  4. Take note of the string shown inside the textbox (highlighted in purple above)
  5. Search for that string in the default keybindings and you shall find what it is bound to.

To remove a keybinding:

  1. Identify the keybinding you would like to remove (e.g:)
{ "key": "ctrl+shift+1",          "command": "editor.action.replaceOne",
                                     "when": "editorFocus && findWidgetVisible" },

2.a. Completely free up the keybinding. This will remove all the commands bound to "ctrl+shift+1". Write the following rule:

{ "key": "ctrl+shift+1" }

2.b. Completely remove a command. This will remove all keybindings associated with "editor.action.replaceOne". Write the following rule:

{ "command": "-editor.action.replaceOne" }

2.c. Remove that specific keybinding. Write the following rule:

{ "key": "ctrl+shift+1", "command": "-editor.action.replaceOne" },

Tip: Remember, in VS Code you can modify each and every keybinding to your liking, you are the sole master of your keyboard.

Thank you very much, I read through the Atom bug and your last answer and found the problematic keybinding.

{ "key": "ctrl+alt+[", "command": "paredit.wrapAroundSquare", "when": "editorTextFocus" },

This is marked with an (i) and maps to ctrl+alt+ß on a German layout. Now I have to decide if I finally get used to a international layout for programming or if I remap the binding :)

Is it possible to create a kind of a localized keybinding for a certain keyboard layout?

I'm happy you could identify the problematic keybinding and remove it.

We currently do not support having keyboard layout specific keybindings, #1240 tracks that.

@alexandrudima , I have a similar issue, I cannot type # with a spanish keyboard. I could not find a related keybinding to altgr + 3 which types # in my kb layout. Info on my setup:

  • VSCode Version: Code 1.9.1 (f9d0c687ff2ea7aabd85fb9a43129117c0ecf519, 2017-02-09T00:26:45.394Z)
  • OS Version: Windows_NT ia32 6.1.7601
  • Extensions:

|Extension|Author|Version|
|---|---|---|
|cpptools|ms-vscode|0.10.2|


Steps to Reproduce:

  1. Open VSCode
  2. Try typing #, or any other Alt Gr + number combination (\|@#~€¬)
  3. Nothing appears on screen.

I looked at the similar atom issue but no luck.

Actually, seems my OS keyboard layout was set as US instead of ES (spanish). My bad!

German keyboard on Mac OS with GitLens installed: alt+shift+7 types a backslash, but is mapped to GitLens search history dialog. Just change the keyboard mapping.

Was this page helpful?
0 / 5 - 0 ratings