Bug 2013987
Summary: | Key mapping reset on the Buletooth keyboard after reconnecting it | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Jun Aruga <jaruga> |
Component: | xmodmap | Assignee: | Peter Hutterer <peter.hutterer> |
Status: | CLOSED NOTABUG | QA Contact: | |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 34 | CC: | ajax, ofourdan, peter.hutterer |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2021-10-18 22:55:16 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Jun Aruga
2021-10-14 08:30:20 UTC
Sorry for my typo. The correct one is
> Actual results:
>
> The "a" is printed. The laptop keyboard's "CapsLock" key's light is enabled entering CapsLock mode.
The "a" is "not" printed on the Bluetooth keyboard. The laptop keyboard's "CapsLock" key's light is enabled entering CapsLock mode.
> [bluetooth]# devices > Device XX:XX:XX:XX:XX:C8 Trust Bluetooth Keyboard > [Trust Bluetooth Keyboard]# devices > Device XX:XX:XX:XX:XX:E2 Trust Bluetooth Keyboard Sorry. One more typo. There are 2 kind of masked MAC address. But it's actually on same MAC address. I mistook how to mask the MAC address. I was able to keep changing the key mapping that I want by editing the following file for the bluetooth keyboard even after reconnecting it. ``` $ cat /etc/X11/xorg.conf.d/00-keyboard.conf Section "InputClass" Identifier "system-keyboard" MatchIsKeyboard "on" Option "XkbLayout" "us" Option "XkbVariant" "," Option "XkbOptions" "caps:escape,altwin:ctrl_rwin" EndSection ``` It seems we can change the key mapping by editing or adding the following files if it is needed. /usr/share/X11/xkb/rules/evdev /usr/share/X11/xkb/symbols/<file> However I am still not sure if the behavior of the xmodmap (and .Xmodemap) and setxkbmap commands is a bug or intentional. When was the last time this actually worked? xmodmap/setxkbmap are once-off tools and aren't hotplug-capable (unless you manually run them after device plug), any new device just comes up with the static configuration. This has been the case since server 1.7 or so (Fedora 8, iirc). See e.g. my post from 2010: https://who-t.blogspot.com/2010/06/keyboard-configuration-its-complicated.html > When was the last time this actually worked? xmodmap/setxkbmap are once-off tools and aren't hotplug-capable (unless you manually run them after device plug), any new device just comes up with the static configuration. This has been the case since server 1.7 or so (Fedora 8, iirc). See e.g. my post from 2010: https://who-t.blogspot.com/2010/06/keyboard-configuration-its-complicated.html Thanks for your reply. I have never seen the xmodmap/setxkbmap works with a bluetooth keyboard. This time I tried the bluetooth keyboard at first time. > The fix for all this is simple: make the session handle all keyboards, existing and hotplugged ones, and let it update the config accordingly. Whenever you're using a tool like xmodmap it is your responsibility to reapply the config after changing keyboards. Which brings me back to the article above - it curiously didn't mention that. So I strongly recommend that instead of configuring your keyboard with xmodmap you spend your time helping your favourite desktop environment to provide tools to cover your use-case. OK I did read your blog now. It's very informative with the context of this topic. So, I might find the tool that works on i3 window manager that I am using. > Exiro: no-one stops you from using xmodmap. you'll just have to re-run it all the time, since xmodmap does one thing, and one thing well. but only one thing... Or like someone's comment on the blog, running the xmodmap (e.g. `xmodmap ~/.Xmodemap`) manually again is one option. OK. So, I am fine to close this ticket. Thanks. One more thing, could you tell me the upstream issue ticket URL on X org about this topic if you know it? > Or like someone's comment on the blog, running the xmodmap (e.g. `xmodmap ~/.Xmodemap`) manually again is one option. fwiw, this is basically what gnome, kde and other desktop environments are doing. they listen to device notifications and then apply the configured keymaps accordingly. So automating this is possible, all the data you need is sent out and let's assume somewhen in the last 10 years someone has written a tool for that - you just have to find it :) > could you tell me the upstream issue ticket URL on X org about this topic if you know it? no idea tbh and if there was one we'd have closed it wontfix years ago. xmodmap still works exactly like it used to do before, it's just that everything else has moved around enough that it's no longer having the same effect. |