You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Keyboard layout messed up for KBD_PORTUGUESE_BRAZILIAN_ABNT2. #27
When I try to type any text on any of the GUI applicatuins, the letter doesnt matches the keyboard layout (it works just fine from the command prompt).
Reacted by bl-ue, Jordan Santos, Mikhail Miguel, Breno L, Paweł Piotr Przeradowski, Fabrício Girardi Andreis, Rafael Reis, Simon Holm, Elie Zedeck RANDRIAMIANDRIRAY, Frederico Galvão and 17 more
Reacted by bl-ue, Mikhail Miguel, Anderson Akihiro Suga, Leonidas Villeneuve and Anderson Grüdtner Martins
Setting verbose level to 10
locale is C
Trying to load rules file ./rules/evdev...
Trying to load rules file /usr/share/X11/xkb/rules/evdev...
Success.
Applied rules from evdev:
rules: evdev
model: pc105
layout: us
Trying to build keymap using the following components:
keycodes: evdev+aliases(qwerty)
types: complete
compat: complete
symbols: pc+us+inet(evdev)
geometry: pc(pc105)
xkb_keymap {
xkb_keycodes { include "evdev+aliases(qwerty)" };
xkb_types { include "complete" };
xkb_compat { include "complete" };
xkb_symbols { include "pc+us+inet(evdev)" };
xkb_geometry { include "pc(pc105)" };
};
Setting verbose level to 10
locale is C
Trying to load rules file ./rules/evdev...
Trying to load rules file /usr/share/X11/xkb/rules/evdev...
Success.
Applied rules from evdev:
rules: evdev
model: pc105
layout: us
Trying to build keymap using the following components:
keycodes: evdev+aliases(qwerty)
types: complete
compat: complete
symbols: pc+us+inet(evdev)
geometry: pc(pc105)
xkb_keymap {
xkb_keycodes { include "evdev+aliases(qwerty)" };
xkb_types { include "complete" };
xkb_compat { include "complete" };
xkb_symbols { include "pc+us+inet(evdev)" };
xkb_geometry { include "pc(pc105)" };
};
Assuming you are on Ubuntu, can you configure keyboard layout using "sudo dpkg-reconfigure keyboard-configuration" and restart WSLg by wsl --shutdown or wsl --terminate [distro name] ?
I don't know exactly what i did, i installed full gnome pckages and change my locale to pt_BR.UTF8, also changind some stuff related to the keyboar... and now it's working just fine...
I don't know exactly what i did, i installed full gnome pckages and change my locale to pt_BR.UTF8, also changind some stuff related to the keyboar... and now it's working just fine...
What exactly did you change in the keyboard settings? And did you install the full GNOME DE?
I don't know exactly what i did, i installed full gnome pckages and change my locale to pt_BR.UTF8, also changind some stuff related to the keyboar... and now it's working just fine...
What exactly did you change in the keyboard settings? And did you install the full GNOME DE?
Tried again, but without installing Full Gnome Desktop Experience...
Roberto Alves Neto (@robertoalvesneto), thanks for detail info, WSL alone doesn't manage keyboard layout, but WSLg does. In your case, VcXsrv is being used instead of WSLg, you might need to follow up with VcXsrv. Thanks!
Hideyuki Nagase (@hideyukn88) thanks for your answer! I installed VcXsrv a long time ago and i didn't even know WSLg. I uninstalled VcXsrv and updated all. I still have problems but at least they are new problems 😆.
For anyone else who has similar keyboard problems, check three things:
What GUI you use;
wayland or x11;
you launch your apps by bash or zsh;
In my case, change to wayland made the gnome theme work
export GDK_BACKEND=wayland
For my, run source ~/.zshrc was not enough, it gave an error of DISPLAY :0, so, try reboot your wsl.
And launch my apps by bash instead of zsh made my keyboard language work.
I still don't know how to make the keyboard preferences work by launching the app from zsh, but I've made some progress.
Guilherme Mazoni (@gmazoni), do you still see the issue (without applying your workaround) even using the latest WSL from aka.ms/wslstorepage? thanks!
Hi Hideyuki Nagase (@hideyukn88), thanks for replying, I updated the WSL and it solved my problem, I removed the wsl.conf and checked all my rc profiles to not export and execute setxkbmap.
Nothing of the above was working in a way that I liked in Win11. I wanted this to be automatic, and my choices (done in bashrc and wsl.conf) didn't work. This required running the command again. Also, sometimes it failed, even with the command.
Simplest workaround: changing the keyboard layout in Windows, from ABNT2 to ABNT. The Alt Gr key still works in Windows, and it is now working 100% on WSLg without any additional configuration.
I have a pretty similar problem.
My Windows layouts ru, en.
Tested with gvim with Ubuntu 22.04. I can switch from en to ru with a hotkey but not back. only setxkbmap -layout us switches back to us.
In terminal as usually all works well.
same here. I have German and US key-baord layout installed for Windows. When I switch to US layout and start wsl2, I have also us layout in the wsl2 bash. But emacs started from this bash has then German keyboard layout. really annoying, as emacs becomes useless with this keyboard layout :(
I don't know if matters, but I noticed that when I change the keyboard layout on windows the keyboard on linux gui app starts to work properly, maybe the solution is on what happen when we refresh the keyboard on windows.
When I switch keyboard layouts in windows, both "Serbian Latin" and "Serbian Cyrilc" keyboard layouts print cyrilic chars in WSL2 Wayland apps. Sloveninan, which I have also installed, is recognized OK and prints latin chars just fine.
I have the same problem but I can't try the solutions proposed here because I use openSUSE Tumbleweed and some commands from the solutions are exclusive to ubuntu. ANyone know how to fix the issue on openSUSE? I'm using abnt, not abnt2.
Activity
hideyukn88 commentedon Apr 22, 2021
Thiago Bachi Rehbein (@tb110188) , would you please attach weston.log from /mnt/wslg ? and what keyboard layout do you use in Windows side ?
tb110188 commentedon Apr 22, 2021
i'm reinstalling Ubuntu... And sure, also I do use PT BR (ABNT2)
jordan080 commentedon Apr 22, 2021
I'm having the same issue. My keyboard layout is PT-BR (ABNT2) too, and here's my weston.log file:
weston.log
tb110188 commentedon Apr 22, 2021
Jordan Santos (@jordan080) Thanks...
hideyukn88 commentedon Apr 22, 2021
From your weston.log.
[23:07:28.183] kbd_layout:0x416 kbd_type:0x4 kbd_subType:0x0 kbd_functionKeys:0xc
RDP client is correctly reports 0x416, which is ...
#define KBD_PORTUGUESE_BRAZILIAN_ABNT 0x00000416
Would you please do "setxkbmap -print -verbose 10" on Linux side to see if corresponding layout is installed/configured in Xkb ?
tb110188 commentedon Apr 22, 2021
Setting verbose level to 10
locale is C
Trying to load rules file ./rules/evdev...
Trying to load rules file /usr/share/X11/xkb/rules/evdev...
Success.
Applied rules from evdev:
rules: evdev
model: pc105
layout: us
Trying to build keymap using the following components:
keycodes: evdev+aliases(qwerty)
types: complete
compat: complete
symbols: pc+us+inet(evdev)
geometry: pc(pc105)
xkb_keymap {
xkb_keycodes { include "evdev+aliases(qwerty)" };
xkb_types { include "complete" };
xkb_compat { include "complete" };
xkb_symbols { include "pc+us+inet(evdev)" };
xkb_geometry { include "pc(pc105)" };
};
tb110188 commentedon Apr 22, 2021
weston.log
also here is my weston.log
jordan080 commentedon Apr 22, 2021
My output from "setxkbmap" is pretty much the same as that of Thiago Bachi Rehbein (@tb110188):
Setting verbose level to 10
locale is C
Trying to load rules file ./rules/evdev...
Trying to load rules file /usr/share/X11/xkb/rules/evdev...
Success.
Applied rules from evdev:
rules: evdev
model: pc105
layout: us
Trying to build keymap using the following components:
keycodes: evdev+aliases(qwerty)
types: complete
compat: complete
symbols: pc+us+inet(evdev)
geometry: pc(pc105)
xkb_keymap {
xkb_keycodes { include "evdev+aliases(qwerty)" };
xkb_types { include "complete" };
xkb_compat { include "complete" };
xkb_symbols { include "pc+us+inet(evdev)" };
xkb_geometry { include "pc(pc105)" };
};
hideyukn88 commentedon Apr 22, 2021
Assuming you are on Ubuntu, can you configure keyboard layout using "sudo dpkg-reconfigure keyboard-configuration" and restart WSLg by wsl --shutdown or wsl --terminate [distro name] ?
tb110188 commentedon Apr 22, 2021
Hideyuki Nagase (@hideyukn88) Nope, still the same issue...
tb110188 commentedon Apr 22, 2021
when I try to type "qwerty" this is what it shows "/,.hxw"...
tb110188 commentedon Apr 22, 2021
I don't know exactly what i did, i installed full gnome pckages and change my locale to pt_BR.UTF8, also changind some stuff related to the keyboar... and now it's working just fine...
jordan080 commentedon Apr 22, 2021
What exactly did you change in the keyboard settings? And did you install the full GNOME DE?
tb110188 commentedon Apr 22, 2021
Tried again, but without installing Full Gnome Desktop Experience...
I think we need that...
tb110188 commentedon Apr 22, 2021
Update:
We don't need Gnome Desktop Experience, but i don't know what else...
70 remaining items
hideyukn88 commentedon Feb 16, 2022
Roberto Alves Neto (@robertoalvesneto), thanks for detail info, WSL alone doesn't manage keyboard layout, but WSLg does. In your case, VcXsrv is being used instead of WSLg, you might need to follow up with VcXsrv. Thanks!
robertoalvesneto commentedon Feb 24, 2022
Hideyuki Nagase (@hideyukn88) thanks for your answer! I installed VcXsrv a long time ago and i didn't even know WSLg. I uninstalled VcXsrv and updated all. I still have problems but at least they are new problems 😆.
For anyone else who has similar keyboard problems, check three things:
waylandorx11;bashorzsh;In my case, change to
waylandmade the gnome theme workexport GDK_BACKEND=waylandFor my, run
source ~/.zshrcwas not enough, it gave an error ofDISPLAY :0, so, try reboot your wsl.And launch my apps by
bashinstead ofzshmade my keyboard language work.I still don't know how to make the keyboard preferences work by launching the app from zsh, but I've made some progress.
References that helped me:
reddit WSLg vs VcXsrv
Context menu doesn't respect screen bounds #641
gmazoni commentedon Apr 22, 2022
This is how I persist the configuration with
/etc/wsl.confhideyukn88 commentedon Apr 22, 2022
Guilherme Mazoni (@gmazoni), do you still see the issue (without applying your workaround) even using the latest WSL from aka.ms/wslstorepage? thanks!
gmazoni commentedon Apr 22, 2022
Hi Hideyuki Nagase (@hideyukn88), thanks for replying, I updated the WSL and it solved my problem, I removed the wsl.conf and checked all my rc profiles to not export and execute setxkbmap.
thomassalmeida commentedon Jun 20, 2022
It worked like a charm. Thanks.
laheinzen commentedon Aug 20, 2022
Nothing of the above was working in a way that I liked in Win11. I wanted this to be automatic, and my choices (done in bashrc and wsl.conf) didn't work. This required running the command again. Also, sometimes it failed, even with the command.
Simplest workaround: changing the keyboard layout in Windows, from ABNT2 to ABNT. The Alt Gr key still works in Windows, and it is now working 100% on WSLg without any additional configuration.
marcioandradejs commentedon Sep 5, 2022
zsh: command not found: setxkbmapSOLUTION
sudo apt-get update sudo apt-get install x11-xkb-utilsDONE! =D
https://command-not-found.com/setxkbmap
Ri0n commentedon Nov 21, 2022
I have a pretty similar problem.
My Windows layouts ru, en.
Tested with
gvimwith Ubuntu 22.04. I can switch from en to ru with a hotkey but not back. onlysetxkbmap -layout usswitches back to us.In terminal as usually all works well.
kierke-gaard commentedon Nov 22, 2022
same here. I have German and US key-baord layout installed for Windows. When I switch to US layout and start wsl2, I have also us layout in the wsl2 bash. But emacs started from this bash has then German keyboard layout. really annoying, as emacs becomes useless with this keyboard layout :(
nascimento210 commentedon Feb 5, 2023
I don't know if matters, but I noticed that when I change the keyboard layout on windows the keyboard on linux gui app starts to work properly, maybe the solution is on what happen when we refresh the keyboard on windows.
MouraVocal commentedon Feb 28, 2023
For my pt-br keyboard worked these steps:
1- in your zsh terminal type:
select PT-BR UTF-8 with space key on keyboard and click "ok"
2 - type a new command on terminal:
3 - On your ~/.zshrc file adds the lines:
Don't forget to restart terminal for load zshrc file changes.
If you do not use Zsh, try to edit ~/.bashrc file instead
thanks Marcio Andrade (@marcioandradejs) and Paulo Sérgio Cotrim (@PauloCotrim) for the references
dmajkic commentedon Mar 16, 2023
When I switch keyboard layouts in windows, both "Serbian Latin" and "Serbian Cyrilc" keyboard layouts print cyrilic chars in WSL2 Wayland apps. Sloveninan, which I have also installed, is recognized OK and prints latin chars just fine.
perryrip commentedon Aug 2, 2023
I have the same problem but I can't try the solutions proposed here because I use openSUSE Tumbleweed and some commands from the solutions are exclusive to ubuntu. ANyone know how to fix the issue on openSUSE? I'm using abnt, not abnt2.
cassiocsantana commentedon Jan 15, 2024
Does anyone know how to persist, wsl.conf is not being executed, because I added 'command = ' and it didn't work