Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upKeyboard mappings with `setxkbmap` on Linux not working #23991
Comments
|
Same, with swapescape. Oddly caps lock works as escape to cancel in the keybinding editor, and either caps lock or escape cancel the F1 menu. Tried disabling all extensions, wiping user settings and using an empty workspace to no avail. I have problems with numpad keys too. With num lock off they do nothing, but work as number keys with it on. If I press a direction with numpad off, nothing happens, but then turn it on and type a number and the cursor will move and then put the number. In the keyboard shortcuts editor numpad PgDn, for example, shows up as numpad3 whether num lock is on or off. |
|
This is something that might be broken by us dispatching based on scan codes. I am sorry about it, I need some time to investigate how these options should be handled. i.e. should Chromium handle these mappings or should we do it at the application layer. Workaround to switch VS Code to dispatch based on key code again. Add the following setting: |
|
Thanks for the workaround! |
|
The workaround works like a charm, thanks! |
|
I have a similar issue, with my Caps Lock bound to Control, where Code is unable to autoclose the quick open window when pressing Ctrl+Tab and then releasing Control. I've tested the workaround and it does not solve this issue. Note: this appears to be specifically an issue with detecting the modifier key. Caps+Tab still launches the quick open just fine, and I have other remapped key bindings for arrow key movements that also work fine. |
|
this workaround isn't working for me on vscode 1.12.2-1.. |
|
@navdeepio Can you please follow our troubleshooting guide at https://github.com/Microsoft/vscode/wiki/Keybindings#troubleshoot If nothing in there works, then please proceed to create a new issue using the steps in the "I have tried all of the above" section. |
|
@alexandrudima Do you guys plan on fixing this issue at some point? Or is the workaround satisfactory as a long term solution? |
|
@Chillee This method needs to be enhanced to account for |
|
Is it tricky or is it feasible as a first time contribution? |
|
I found a partial workaround that might help other vim users. I tweaked the idea in https://dev.to/karlredman/navigate-your-vscode-like-its-1999-the-vim-way-3632 by adding the following to
This shouldn't be this hard. Sigh. |
|
I found similar key rebinding problems with the new great jupyter notebook editor of the python extension. Yet in the general editor and dialogs it works for me without a problem |
Where to add this? |
|
This bug is still present, but the workaround also still works for me. I use the Workman-P keyboard layout, which has |
|
The Dell XPS 13 7390 has a different home/end/pgup/pgdn layout than previous models. Problem is that the "original" PgUp and PgDn keys that I thought I disabled are still working on Electron apps, even though they're disabled for all the non electron apps. This is what xev shows for the disabled PgDn:
I can work around it by directly using |
|
For reference, my previous comment is still correct. Using |
|
This is unbelievable. Only project I know of that has this problem. Never had an issue before. And a project this size, for programmers, still hasn't fixed this after years? Embarrassing. |
|
@kylebakerio Maybe you can ask for a refund. |
|
@kylebakerio Maybe don't use Microsoft software on linux. |
|
This is how I make Caps Lock an additional Esc for vim extension in vscode in POP!_OS 19.10:
|
|
For whatever it's worth, giving vscode another try after all these years, now on a clean debian 10 install, with a less complex keyboard setup (haven't gotten around to it), it seems to work... Only thing I've done is set caps lock to be ctrl using gnome-tweaks. ... until I tried setting a custom hotkey that is a default in sublime text, which is auto-indent on paste. When I tried to set to ctrl+shift+v, it somehow got confused by the capslock being a control again, and started making it so that I'd have to hit my hotkeys twice for them to work. I noticed some funniness with the input reading, it noticed it was capslock and didn't respect that it should ignore it is capslock and that it is just a ctrl. I quickly just turned it off and manually indent things for now. I'm in the middle of a project, so I'm just giving vscode a chance for now. Given this, I imagine if I had all my language settings and key modifiers, it still would have trouble dealing with keyboard inputs. Maybe when my current sprint is done I'll spend some time getting to know vscode and trying to give it a chance, but this is just not a good sign. |
|
Thanks, It solved my problem as well. Awesome! |
|
Hi, @sholderbach. Have you made it work in jupyter? I am trying to map { "key": "escape", "command": "notebook.cell.quitEdit","when": "inputFocus && notebookEditorFocused" },In self keybings.json, Changing |
|
The workaround stopped working randomly, It did not improve after a reinstall. It particularly stopped working while on jupyter notebooks, on the rest of the app it works fine. Version: 1.49.0 |
|
|



I have my Caps Lock key bound to Escape using
setxkbmapon Linux. This worked fine till 1.10, but broke with 1.11. At first I thought it was an issue with the VSCodeVim extension, but the issue persists with all the other Vim extensions on the marketplace as well. Pressing the escape button still works as expected.The binding is still respected everywhere else in the operating system, it's only Visual Studio Code that ignores it for some reason.
Steps to Reproduce:
setxkbmap -option caps:escape(binds caps to escape for the duration of the session)