Vscode: VS Code no longer respects remapped escape key using xmodmap

Created on 4 Aug 2017  路  4Comments  路  Source: microsoft/vscode

  • VSCode Version: Code 1.14.2 (cb82febafda0c8c199b9201ad274e25d9a76874e, 2017-07-19T23:26:08.116Z)
  • OS Version: Linux x64 4.9.6-gentoo-r1
  • Extensions:

Extension|Author (truncated)|Version
---|---|---
head-file-guard|bjr|0.0.2
python|don|0.7.0
vscode-rust|kal|0.4.2
cpptools|ms-|0.12.2
final-newline|sam|0.3.2

change-case|wma|1.0.0

I use xmodmap to swap the meaning of the Esc and Caps Lock keys. In other words, I press the physical Esc key to enable caps lock (very rare) and the physical Caps Lock for escape (very common). This used to work fine in VS Code 1.8.1 but misbehaves in 1.14.2. VS Code is the only software I have used that does this.

Swapping Esc and Caps Lock is common among Vim users, who frequently use the Esc key. See e.g. http://vim.wikia.com/wiki/Map_caps_lock_to_escape_in_XWindows.

Steps to Reproduce:

  1. Make a file swap_escape with the following content:
remove Lock = Caps_Lock  
keysym Escape = Caps_Lock
keysym Caps_Lock = Escape
add Lock = Caps_Lock
  1. Use xmodmap to remap the keys
xmodmap swap_escape
  1. Caps Lock should now perform the function typically assigned to Esc, and vice versa.

  2. Select some text in VS Code. Press the Caps Lock key. Expected: text is unselected (because the key means escape to the OS). Observed: nothing happens.

  3. Select some text in VS Code. Press the Esc key. Expected: selection remains, caps lock is enabled in the OS. Observed: Text is unselected _and_ caps lock is enabled in the OS.

Reproduces without extensions: Yes

*duplicate editor

Most helpful comment

You could set

"keyboard.dispatch": "keyCode"

in settings (works for me).

All 4 comments

The same issue as of VSCode Version: Code 1.15.0 (8b95971d8cccd3afd86b35d4a0e098c189294ff2, 2017-08-09T20:09:15.006Z)

You could set

"keyboard.dispatch": "keyCode"

in settings (works for me).

Yes, setting "keyboard.dispatch": "keyCode" works around the issue for me also (though I'm assuming this will introduce other limitations related to keyboard layout changes).

Searching for "keyboard.dispatch" I ran across a duplicate for this issue: #23991. Don't know why it didn't turn up in search results before, sorry for the noise.

Was this page helpful?
0 / 5 - 0 ratings