Skip to content

Support contributing different keybindings based on keyboard layout #1240

Open

Description

VSCode should ship out of the box with multiple keymaps (based on/optimized for each keyboard layout).
e.g. toggle line comment should be ctrl+7 on swiss keyboards, etc.

VSCode should detect at runtime the current system keyboard layout and employ different defaults, based on the keyboard layout.

Activity

  1. added
    feature-request
    on Dec 14, 2015
  2. added
    bug
    and removed
    feature-request
    on Dec 14, 2015
  3. bpasero commented on Dec 14, 2015

    @bpasero
    Contributor

    Hm it should be...

  4. bpasero commented on Dec 14, 2015

    @bpasero
    Contributor

    So Cmd++ works for me, which is cool. However what is weird is that we set the keybinding like this:

    { primary: KeyMod.CtrlCmd | KeyCode.US_EQUAL }

    I could not find KeyCode.US_PLUS.

    alexandrudima can you comment on this maybe?

  5. weinand commented on Dec 14, 2015

    @weinand
    ContributorAuthor

    Benjamin Pasero (@bpasero) does Cmd++ work for you on a non-US keyboard?

  6. bpasero commented on Dec 14, 2015

    @bpasero
    Contributor

    Andre Weinand (@weinand) yes I am on german keyboard layout (ibm) and interestingly when I type "Cmd++" into the keyboard widget, I see it prints Cmd+= for me. What does it print for you?

  7. weinand commented on Dec 14, 2015

    @weinand
    ContributorAuthor

    Benjamin Pasero (@bpasero) I'm on a Swiss German keyboard and I see "shift+cmd+=" and I know where the '=' comes from. On a US keyboard the '+' and the '=' are together on a key and since we only have KeyCode constants for the unshifted key, it is KeyCode.US_EQUAL.

    Benjamin Pasero (@bpasero) restating my question from above: did Cmd++ work for you without changing the keybinding?

  8. 10 remaining items

  9. patrys commented on Sep 11, 2018

    @patrys

    I think it's maybe time to revive this issue. A number of other issues have been merged into this one including a lot of issues about languages that depend on AltGr. Now AltGr is a technique that gives one or both Alt a special function of switching to a secondary keyboard layout group.

    Polish for example depends on AltGr to to switch between naked characters and accented ones. Pressing Z gives you Z while pressing Alt+Z gives you Ż. Polish diacritics are not otherwise available as separate keys (long story short: there used to be a Polish typist keyboard layout and typewriters used it but we had to import computers with US keyboards because communism).

    Now Alt+Z from the example above is currently mapped to "toggle word wrap". This means we can't type in Polish without remapping parts of the keyboard.

  10. alexdima commented on Sep 12, 2018

    @alexdima
    Member

    Patryk Zawadzki (@patrys) On mac we ship with 516 default keybindings. There are hundreds of possible keyboard layouts only on the mac and it is possible for people to customize them and create their own keyboard layouts.

    It is difficult to find key combinations which are both easy enough to be remembered, easy enough to be ergonomically feasible and which work across a wide number of the keyboard layouts well.

    The correct fix for your case is for VS Code to ship with Alt+Z as the keybinding for toggle word wrap for every keyboard layout except the Polish one, under which Alt+Z should be kept free such that Ż can be produced. So issue #50053 is indeed a duplicate of this issue.

  11. Tekbr commented on Sep 19, 2018

    @Tekbr

    -- Sorry for the English, I used Google Translator --

    I know the team has put a lot of resources into the VSCode. So much that it has much prominence in Windows, OS X and Linux and in several languages and not only in English.

    And because of this dimension, I think you can already pay attention to Keyboard Layout for a variety of languages. Regardless of the number of votes. As I see it is a trivial resource. It already has a lot of other cases related precisely because of this problem.

    It is very bad you look for a certain type of shortcut (which is in US standard) and when using in your layout (in my case PT-BR2) it does not match or be seen otherwise.

    This affects both the VSCode and the extensions used in it.

    But I want to congratulate the team for their great work.

    Thanks for the attention.

    // ping alexandrudima

  12. jrpub commented on Mar 11, 2019

    @jrpub

    Refering to #32473 (which has been closed), to open terminal on many french laptops:

    ctrl + ù

    Sorry if it has been already disclosed, I didn't read everything, just wanted to put the tips.

  13. kingma-sbw commented on Feb 24, 2020

    @kingma-sbw

    It is possible to find the key bindings under
    File, Preferences, Keyboard shortcuts.

    What is annoying is that Help, Keyboard Shortcuts Reference points to a pdf that has no relation to the actual key bindings. Keybindings depend on the language. The PDF should state its specific validity for US American Keyboard layout.

  14. fleps commented on Mar 18, 2021

    @fleps

    I have a small programable keyboard that uses BootMapper Client to setup keybinds. It's configured to send the normal extra "F" keys tradicional keyboards don't have like F20, 21, 22, 23, 24, which are all valid keys.
    For some reason VSCode does not detect these keys (but any other software does)

    If I try to use the F20 key, what I get is an "unknown"
    Using the debugger, I get this:

    / Received keydown event - modifiers: [], code: F20, keyCode: 131, key: F20
    | Converted keydown event - modifiers: [], code: F20, keyCode: 0 ('unknown')
    \ Keyboard event cannot be dispatched in keydown phase.

    If I use other keys like F12, this doesn't happen, even if I program the F12 to come from the macro keyboard.

    Why VSCode just don't use the KeyCode? Why does it need to "convert" it??

    It seems we had a setting in the past that fixed this on Windows ( "keyboard.dispatch": "keyCode" ) but now this setting is not valid anymore.

    Again, why? Why overcomplicate such a simple thing for valid keyCodes that exist since forever?

  15. Lemmingh commented on Sep 24, 2021

    @Lemmingh
  16. Lemmingh commented on Sep 24, 2021

    @Lemmingh
    Contributor

    I guess I get your idea now. The "F20" case seems to be an issue from Chrome.

    https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values

  17. removed
    keybindings
    on Oct 18, 2021
  18. ajmas commented on Oct 19, 2021

    @ajmas

    On the Mac using the option key, without the command key is problematic as it prevents the use of the alternative characters, that are only accessible when holding down the option key.

    Using the control key is probably less bad, but it should be noted that certain combinations, such as ctrl-A, correspond to emacs style keyboard navigation that works in all text fields.

    For example, I use a US keyboard, but being in a multilingual environment will sometimes needs to add an accent. These accents are available via the option key. The full range of characters available can be seen via the virtual keyboard. My workaround is to not use VS Code when I need to write things that need the full keyboard, since remapping all the VS Code short cuts is just too tedious.

  19. Fred-Vatin commented on Jul 29, 2026

    @Fred-Vatin

    This could be solved if VSCode had an option to interpret characters as valid shortkeys, just like editors like VIM, Helix, Zed and so on.

    For instance, VSCode (on Windows at least) interprets AltGr as Ctrl+Alt. So any layout using AltGr+[key] to produce a special character could conflict with the shortkey Ctrl+Alt+[key] instead of outputting the desired char.

    The workaround is to create a layout that replaces AltGr with Kana. I linked Kana to OEM_8 with KbdEdit. Now Kana+[key] will output the desired character without conflict. But it is impossible to use this character as a shortkey.

    For instance, in my layout, I have Kana+F to output /. Here is how this is interpreted by VSCode:

    2026-07-29 05:24:42.237 [info] [Window] [KeybindingService]: / Soft dispatching keyboard event
    2026-07-29 05:24:42.237 [info] [Window] [KeybindingService]: | Resolving OEM_8
    2026-07-29 05:24:42.237 [info] [Window] [KeybindingService]: \ No keybinding entries.
    2026-07-29 05:24:42.238 [info] [Window] [KeybindingService]: / Received  keydown event - modifiers: [], code: AltRight, keyCode: 223, key: Unidentified
    2026-07-29 05:24:42.238 [info] [Window] [KeybindingService]: | Converted keydown event - modifiers: [], code: AltRight, keyCode: 96 ('OEM_8')
    2026-07-29 05:24:42.238 [info] [Window] [KeybindingService]: | Resolving OEM_8
    2026-07-29 05:24:42.242 [info] [Window] [KeybindingService]: \ No keybinding entries.
    2026-07-29 05:24:42.253 [info] [Window] [KeybindingService]: / Soft dispatching keyboard event
    2026-07-29 05:24:42.253 [info] [Window] [KeybindingService]: | Resolving F
    2026-07-29 05:24:42.253 [info] [Window] [KeybindingService]: \ From 13 keybinding entries, no when clauses matched the context.
    2026-07-29 05:24:42.253 [info] [Window] [KeybindingService]: / Received  keydown event - modifiers: [], code: KeyF, keyCode: 70, key: /
    2026-07-29 05:24:42.253 [info] [Window] [KeybindingService]: | Converted keydown event - modifiers: [], code: KeyF, keyCode: 36 ('F')
    2026-07-29 05:24:42.253 [info] [Window] [KeybindingService]: | Resolving F
    2026-07-29 05:24:42.254 [info] [Window] [KeybindingService]: \ From 13 keybinding entries, no when clauses matched the context.
    

    Please, add an option to detect key as keybinding when it is identified.

    This would make life so much easier for so many users who rely on custom or specific keyboard layouts, or Kanata, which sends characters via its Unicode function that are also detected by VSCode as a key.

    It is a pain to have to use other keybindings on VSCode because of this when switching with other editors constantly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestkeyboard-layout

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions