vscode: keyboard shortcuts: wrong interpretations of special keys (e.g. `[Equal]` is mistaken for `V`)
Type: Bug
- Update VS Code (for me, it was from
1.74.1
to1.75
) - User defined keybindings using scan codes (e.g.
[Equal]
or[Semicolon]
) are interpreted incorrectly
More details
I was literally unable to copy-paste inside VS Code because pasting was also ctrl+v
…
VS Code version: Code 1.75.0 (e2816fe719a4026ffa1ee0189dc89bdfdbafb164, 2023-02-01T15:29:17.766Z) OS version: Linux x64 5.15.0-58-generic Modes: Sandboxed: No
System Info
Item | Value |
---|---|
CPUs | Intel® Core™ i7-4770K CPU @ 3.50GHz (8 x 3899) |
GPU Status | 2d_canvas: enabled canvas_oop_rasterization: disabled_off direct_rendering_display_compositor: disabled_off_ok gpu_compositing: enabled multiple_raster_threads: enabled_on opengl: enabled_on rasterization: enabled raw_draw: disabled_off_ok skia_renderer: enabled_on video_decode: disabled_software video_encode: disabled_software vulkan: disabled_off webgl: enabled webgl2: enabled webgpu: disabled_off |
Load (avg) | 0, 0, 0 |
Memory (System) | 15.57GB (11.48GB free) |
Process Argv | –disable-extensions --crash-reporter-id 82449883-a908-4a7a-be3e-fc9cf8042ab0 |
Screen Reader | no |
VM | 0% |
DESKTOP_SESSION | regolith |
XDG_CURRENT_DESKTOP | Regolith:GNOME-Flashback:GNOME |
XDG_SESSION_DESKTOP | regolith |
XDG_SESSION_TYPE | x11 |
superseeds #173324
Known workarounds:
- update to latest Insiders or latest stable 1.75.1.
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 29
- Comments: 31 (7 by maintainers)
Commits related to this issue
- fix(keybindings): fix hashcode scancode/simplekey The issue was introduced in this PR https://github.com/microsoft/vscode/pull/169842 The hashcode for scan codes and simple keys was not updated to di... — committed to hamzahamidi/vscode by hamzahamidi a year ago
- fix(keybindings): fix hashcode for scan codes & simple keys (#173456) * fix(keybindings): fix hashcode scancode/simplekey The issue was introduced in this PR https://github.com/microsoft/vscode/pu... — committed to microsoft/vscode by hamzahamidi a year ago
- Fixes #173325 — committed to microsoft/vscode by alexdima a year ago
- Avoid hash collisions between `KeyCodeChord` and `ScanCodeChord` (#173585) Fixes #173325 — committed to microsoft/vscode by alexdima a year ago
- fix(keybindings): fix hashcode for scan codes & simple keys (#173456) * fix(keybindings): fix hashcode scancode/simplekey The issue was introduced in this PR https://github.com/microsoft/vscode/pu... — committed to c-claeys/vscode by hamzahamidi a year ago
This is a rather urgent and serious bug 🤔 is there a way to give priority to this issue? @georglauterbach
When is it possible to release this hotfix? It’s pretty urgent.
The fix was merged. Thanks @alexdima and Thank you @hamzahamidi for the quick fix
Potential fix here. The issue was introduced here. The hashcode for scan codes and simple keys was not updated to distinguish between them.
I’m super sorry for this regression! I’m trying to get the change into tomorrow’s Insiders and we’ll very likely ship it with
1.75.1
. I’ve updated the issue description with a potential workaround which consists of editing the scan code based user bindings to use key code.ping @alexdima; this should probably have high priority as broken keyboard shortcuts really cut the experience of using VS Code short
We plan to release
1.75.1
tomorrow.The issue has messed up a lot of my custom shortcuts and is incredibly annoying:
[BracketRight]
is mapped to X.[BracketLeft]
is mapped to W.[Comma]
is mapped to F2.[Equal]
is mapped to V.[Minus]
is mapped to U.These are the ones that have been affected for me from a quick glance. I’m shocked that this was released :0
Verified in stable release candidate (Version: 1.75.1 Commit: 30b39f04b4b323377f4131bc76a3b7bc5f60475d)
For me on a german layout,
cmd+y
iscmd+#
for some reason, now I can’t redo anymore.edit: just confirmed that this issue isn’t present on 1.74.3
I have the same issue on VSCodium, on a US keyboard layout
Additionally, these keycodes are also broken:
[Backquote]
is mapped to F1 but not when used withctrl+alt+[Backquote]
(that works as intended)[Backslash]
is mapped to Y on both IT and US layouts (I assume it’s the same for all layouts then)downgrading to 1.74.3 works
@hamzahamidi Thank you for tracking this down! This is indeed caused by the implementations of
KeyCodeChord.getHashCode()
andScanCodeChord.getHashCode()
, which produce strings which overlap.For example:
ctrl+v
will have the hash code100052
.ctrl+[Equal]
will also have the hash code100052
.Can confirm.
Pressing
[Ctrl]+[#]
on the keyboard shortcut settings page with a German keyboard adds"key": "ctrl+[Backslash]"
tokeybindings.json
. This behavior (config write) is the same on 1.74.x as well as 1.75.0. However, the interpretation of this (config read) is different:On 1.74.x, this used to work, i.e.
ctrl+[Backslash]
in the config did correspond to a physical key press of[Ctrl]+[#]
in the editor using a German keyboard.However, on 1.75.0 this config entry reacts to a physical keypress of
[Ctrl]+[Y]
only. Thus, VSCode does not correctly interpret thekeybindings.json
entry it wrote itself (even if written with 1.75.0, this is not a config migration problem):[Ctrl]+[#]
-> “ctrl+[Backslash]”[Ctrl]+[Y]
I’m hoping this gets a high priority. It completely messed up a lot of my key bindings.
Released on a friday 😉 Have a nice weekend ya’ll!
related: https://stackoverflow.com/questions/75336265/vscode-says-equal-key-is-v-keyboard-layout-messed-up
Same here.
[Minus]
is replaced byU
and[Equal]
byV
. That’s really annoying.