-
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
KDE: Reading keyboard layout reads the wrong one #24166
Comments
On Linux, we don't detect when keyboard layouts are changed while VS Code is running. We read the keyboard layout information on start-up and cache it for the entire lifecycle of the window. I'm thinking you're not hitting this issue and you are restarting vscode in between changing keyboard layouts. We use X11 APIs in the C++ node module to determine the current keyboard layout and its mappings. We loop over each "scan code", fabricate an 4 XEvent(s) (with various modifier keys on/off), dispatch it, and read the produced characters: https://github.com/Microsoft/node-native-keymap/blob/master/src/keyboard_x.cc#L171 I have seen this reported before on CentOS - #23505 I am not sure I understand what's going on, it appears that changing the keyboard layout at the Operating System level fails to update the keyboard layout as seen by X11 or by our used APIs in X11. In other words, on Ubuntu, for example, changing the keyboard layout from the OS results in X11 being aware of the change. In other words, it appears under Ubuntu, switching the keyboard layout results internally in a |
A workaround in the meantime would be to force us back into dispatching based on
|
Related: #23505 |
A similar issue started happening with me on Fedora 25. Edit: the suggested workaround seems to fix it for me. Thanks for that! Really! |
Hey, just to clarify, for me the workaround was changing the layout order returned by |
I can reproduce the bug in Ubuntu and Manjaro GNOME. What's the downside of using |
I have the same issue in Kubuntu 18.04.1. Interestingly, I have the issue in IntelliJ 18.2 too. |
This just happened to me in Ubuntu 19.04 with Gnome3, no KDE involved. Maybe we could replace the |
Is it worth making a list of operating systems that, if they are affected by this bug that the |
I have a same issue in Mac OS The actual layout when writing text, is correctly set to AU, but shortcuts are interpreted as JP.
|
Same issue here using LATAM Keyboard Layout on Kubuntu 18.04 and VSCode 1.50.0 Apparently configuration is alright but key mappings are messed up, some keybindings just wouldn't work (eg. ctrl+} was being read as ctrl+]). On VSCode:
On bash
|
The problem hits me as well. I have started VSCode when on regular QUERTY layout and changed to COLEMAC after when using external keyboard:
For keyboard shortcuts VSCode still works like I have had a QUERTY layout.
|
I'm having the same issue using Ubuntu 20.04. I'm using a notebook with an external US international keyboard. I frequently change between Brazilian Portuguese layout (for chatting) and English US layout (for coding). Everything works fine while I'm typing on VSCode. But keyboard shortcuts are always being executed as Brazilian Portuguese layout, which actually prevents me from running some of them. @alexdima workaround fixed it for me.
|
@alexdima Yup, you're right, i'm on Linux (Mint). For everyone else, as already mentioned, EDIT: This also is a big problem with a family of German keyboards (NEO and it's derivatives). Quite a few of the movement-keys on layer 4 (can be seen here https://maximilian-schillinger.de/keyboard-layouts-neo-adnw-koy.html) are ignored by VS Code. |
Same issue here, I recently started switching between DE and US keyboard layouts regularly (my laptop keyboard is DE but the external keyboard I am using is US) and vscode now acts up and interprets shortcuts as DE even when the active layout is US. All other applications work fine, so this must be something quirky about how vscode specifically receives keyboard input. I am using KDE. Thanks for pointing me to the
Restarting vscode does not help, so that is not the problem. |
I agree that this would be very helpful for a lot of people. |
While we now detect the active keyboard layout correctly on startup, the issue #23690 still remains, i.e. we do not detect the active keyboard layout changes while VS Code is running. To verify, you can use Ubuntu 20.04 and install additional keyboard layouts e.g. you can install German:
|
Since version 1.11.1 (last I used was 1.10.2), the shortcut to "Toggle Line Comment" (which was
Ctrl+/
) now zooms out, like when pressing (Ctrl+-
). PressingCtrl+Shift+7
does work, butShift+7
is&
. The actual layout when writing text, is correctly set to US, but shortcuts are interpreted as DE.Steps to Reproduce:
Inside
Developer: Inspect Key Mappings
there is noVK_OEM_2
.Some interesting values:
The issue seems to be that when there are multiple layouts configured, VS Code sets as key layout the first value for
layout
formsetxkbmap -query
, ignoring the current layout. If I switch to been,de
then VS Code uses the EN layout, as it is the first in the list. It would be handy if VS Code could use the current layout instead of the first from the list.The text was updated successfully, but these errors were encountered: