question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Keyboard mappings with `setxkbmap` on Linux not working

See original GitHub issue
  • VSCode Version: 1.11.0
  • OS Version: Ubuntu 16.04

I have my Caps Lock key bound to Escape using setxkbmap on 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:

  1. Run setxkbmap -option caps:escape (binds caps to escape for the duration of the session)
  2. Hitting caps lock when in insert mode (with a Vim extension like VSCodeVim installed) no longer puts you normal mode.
  3. Hitting escape still works as expected and puts you in normal mode.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:249
  • Comments:89 (8 by maintainers)

github_iconTop GitHub Comments

565reactions
alexdimacommented, Apr 6, 2017

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: "keyboard.dispatch": "keyCode" and restart VS Code

25reactions
mahkohcommented, Mar 14, 2020

@kylebakerio Maybe don’t use Microsoft software on linux.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to (permently) set keyboard mappings using setxkbmap ...
I have already spent several hours googling and trying different things to resolve the problem, like: sudo, clearing cache, rebooting, ...
Read more >
Setxkbmap not working - changing kb layout
The problem is, that setxkbmap seems to have absolutely no effect on my system. I tried: adding exec --no-startup-id "setxkbmap -layout us,en - ......
Read more >
Why does "setxkbmap de" not have an effect in a terminal?
Try to use the keyboard shortcut for switching layout instead of the setxkbmap command. The default shortcut is <Super>+<Space>. – Gunnar ...
Read more >
Xorg/Keyboard configuration - ArchWiki
Note: Fcitx/IBus users may find these methods not working, ... setxkbmap sets the keyboard layout for the current X session only, ...
Read more >
Keyboard - Debian Wiki
To configure the keyboard for Linux kernel and X, you have to install keyboard-configuration. The package console-setup is also needed.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found