-
Notifications
You must be signed in to change notification settings - Fork 29.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom keyboard layouts does not works properly on ozone wayland only mode #127932
Comments
I just compared the log while pressing the same key
9,12c9,10
< [renderer1] [info] [KeybindingService]: | Resolving ctrl+shift+[Equal]
< [renderer1] [info] [KeybindingService]: \ From 1 keybinding entries, matched workbench.action.terminal.toggleTerminal, when: terminal.active, source: built-in.
< [renderer1] [info] [KeybindingService]: | Resolving ctrl+shift+[Equal]
< [renderer1] [info] [KeybindingService]: \ From 1 keybinding entries, matched workbench.action.terminal.toggleTerminal, when: terminal.active, source: built-in.
---
> [renderer1] [info] [KeybindingService]: | Resolving ctrl+shift+=
> [renderer1] [info] [KeybindingService]: \ From 1 keybinding entries, matched workbench.action.zoomIn, when: no when condition, source: built-in. The logs on wayland are also different. |
I just read this on Keybinding issues
So seems this rely on vscode to deal with vscode keybinging handling on wayland. using So here is the comparison of the log of using vscode under Xorg and Wayland. $ colordiff -u300 <(cut -c27- code-dispatch-works-properly-open-integrated-terminal.txt) <(cut -c27- wayland-code-unexpected-behavior-zoom-in.txt)
--- /proc/self/fd/14 2021-07-03 19:43:04.652710167 +0000
+++ /proc/self/fd/16 2021-07-03 19:43:04.652710167 +0000
@@ -1,14 +1,12 @@
[renderer1] [info] [KeybindingService]: / Received keydown event - modifiers: [ctrl], code: ControlLeft, keyCode: 17, key: Control
[renderer1] [info] [KeybindingService]: | Converted keydown event - modifiers: [ctrl], code: ControlLeft, keyCode: 5 ('Ctrl')
[renderer1] [info] [KeybindingService]: \ Keyboard event cannot be dispatched in keydown phase.
[renderer1] [info] [KeybindingService]: / Received keydown event - modifiers: [ctrl,shift], code: ShiftLeft, keyCode: 16, key: Shift
[renderer1] [info] [KeybindingService]: | Converted keydown event - modifiers: [ctrl,shift], code: ShiftLeft, keyCode: 4 ('Shift')
[renderer1] [info] [KeybindingService]: \ Keyboard event cannot be dispatched in keydown phase.
-[renderer1] [info] [KeybindingService]: / Received keydown event - modifiers: [ctrl,shift], code: Equal, keyCode: 187, key: `
+[renderer1] [info] [KeybindingService]: / Received keydown event - modifiers: [ctrl,shift], code: Equal, keyCode: 187, key: Unidentified
[renderer1] [info] [KeybindingService]: | Converted keydown event - modifiers: [ctrl,shift], code: Equal, keyCode: 81 ('=')
-[renderer1] [info] [KeybindingService]: | Resolving ctrl+shift+[Equal]
-[renderer1] [info] [KeybindingService]: \ From 1 keybinding entries, matched workbench.action.terminal.toggleTerminal, when: terminal.active, source: built-in.
-[renderer1] [info] [KeybindingService]: | Resolving ctrl+shift+[Equal]
-[renderer1] [info] [KeybindingService]: \ From 1 keybinding entries, matched workbench.action.terminal.toggleTerminal, when: terminal.active, source: built-in.
-[renderer1] [info] [KeybindingService]: + Storing single modifier for possible chord ctrl.
+[renderer1] [info] [KeybindingService]: | Resolving ctrl+shift+=
+[renderer1] [info] [KeybindingService]: \ From 1 keybinding entries, matched workbench.action.zoomIn, when: no when condition, source: built-in.
+[renderer1] [info] [KeybindingService]: + Storing single modifier for possible chord shift.
[renderer1] [info] [KeybindingService]: + Clearing single modifier due to 300ms elapsed. |
Not sure if this could help, here is the ouput of libinput debug events for pressing
|
I guess this requires wayland support for node-native-keymap microsoft/node-native-keymap#17 I still wonder if there is a way to workaround this for me by something like hard-code programmer dvorak to my vscode build. |
@alexdima vscode works properly with I've read this on Keybinding Issues, and I can confirm
setxkbmap simply won't work on wayland only mode. user@hostname ~ $ setxkbmap -query # X11, works properly with e.code
rules: evdev
model: pc104
layout: us
variant: dvp
user@hostname ~ $ setxkbmap -query # wayland with xwayland, works properly with e.code
rules: evdev
model: pc105
layout: us
user@hostname ~ $ setxkbmap -query # wayland-only, no X11. e.code or e.keyCode, lots of keybindings does not work
Cannot open display "default display" To use vscode in wayland-only mode, I need to launch vscode with this arguments Since node-native-keymap only support X11 for linux, it's probably that vscode can't get proper keymap on wayland-only mode (mostly only letter keys works properly for keybindings) |
keyboard input is usually handled by libinput under wayland. but I haven't find related API for querying layout variant or keymap. anyway for now I just want to have a temporary solution by patching and build vscode to hard-code programmer dvorak keyboard layout, so that it could work for me under wayland only mode. could you tell me how to do so? I'm unable to find the exact code which I need to edit. so far I've only found this vscode/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.ts Lines 471 to 473 in ee1e84d
and vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en.linux.ts but maybe this one is not used for my case? I tired to replace it with programmer dvorak and it does not change anything. |
Thank you, that clarifies things, so I understand now. I'm real sorry, but I don't think we have anything short of a code change to help here. The A possible user workaround (that might be costly to author) would be for you to manually define the keybindings you care about using the code format in your
You can potentially extract them and then copy-paste from when running with X enabled |
Thanks I did what you suggested, patched and built vscodium with Programmer Dvorak as keyboard layout, it works properly. |
microsoft/vscode#127932 - workflow linux: remove scheduled events - remove macos and windows workflows
I similarly am having an issue with the dvorak layout. For now, I worked around this by adding the following to my settings.json: |
Same issue here, I use custom keyboard layout to map ESC to Backquote, all wayland application can input Backquote by pressing ESC except chromium, vscode and chrome, which just recognize ESC as ESC. However, other remapped key is able to work. Setting related content in "Escape": {
"value": "`",
"withShift": "~",
"withAltGr": "`",
"withShiftAltGr": "~",
"withLevel5": "`",
"withLevel3Level5": "`"
}, |
This also happens with popular layouts like e.g. the german layout |
I am experiencing issues as well in Wayland.
I am using the German Neo2 layout for a pc105 keyboard.
This leads to a very annoying issue: I could not provoke the issue in Plasma6 X11, where VSCode detects the right layout. I already have For now, I am hoping that disabling menubar mnemonics somewhat mitigates my particular issue. |
Issue Type: Bug
I'm using Programmer Dvorak keyboard layout, keybindings only works fine on Xorg with default keyboard dispatch (code).
setxkbmap us dvp
for Xorg)./code-insiders --enable-features=UseOzonePlatform --ozone-platform=wayland --no-sandbox
or change keyboard dispatch tokeyCode
Ctrl+Shift+[backtick]
(create new integrated terminal, the last key is located at the left side of BACKSPACE key), it will zoom in instead (because it actually think the user inputedCtrl+#
).I've tried Troubleshooting as well, and I find that it does not follow one single keymap. such like
Ctrl+Shift+e
works, but it shows strange keys (maybe from QWERTY) for most of combined keys especially those ones involves to the keys on number row.Programmer Dvorak keyboard layout:
VS Code version: Code - Insiders 1.58.0-insider (9056b40, 2021-07-03T07:56:06.848Z)
OS version: Linux x64 5.10.27-gentoo
Restricted Mode: No
System Info
gpu_compositing: enabled
multiple_raster_threads: disabled_off
oop_rasterization: disabled_off
opengl: enabled_on
rasterization: disabled_software
skia_renderer: enabled_on
video_decode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
A/B Experiments
I tried to build vscodium as well, would also appropriate if someone could tell a dirty workaround by patching something to get programmer dvorak works for me on wayland. so far I've only notice vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/ but idk what should I edit.
The text was updated successfully, but these errors were encountered: