Bluetooth Keyboard: Compose Key stopped working after few minutes

Hi all,

i’m new to this one, registration process with oauth2 was frustrating, but i get finally there. as you may noted, English is not my native language.

But anyway, i have a little issue with my new fedora 33 Installation on my Lenovo T590 running Gnome 3.38.1 on X11: I’m using a MX Master 3 Keyboard by Logitech (german layout) I’ve enabled Compose key with the tweaking tool mapped to right control. After Login, the key works a few minutes, but after that time it behaves like Right CTRL again.

There is no issue at all, if i’m using the unify receiver.

Any help would be greatly appreciated.

Thanks in advance

2 Likes

This seems to be a likely bluetooth issue. I have a logitech bluetooth keyboard that I reverted back to using the unifying receiver because of certain instabilities in the way it worked. I can’t help with the fix, but you are not the only one to have problems with bluetooth keyboards.

2 Likes

I confirm similar behavior with my Logitech k810 bluetooth keyboard.

Specifically, my compose key binding gets lost in the following scenarios:

  • suspend and wake the computer
  • switch the keyboard power off and back on

My laptop’s builtin keyboard is not affected by this problem; only the bluetooth keyboard is affected.

Workaround #1 (X only, not Wayland):

Alt+F2 r

Workaround #2

#!/bin/bash
save=$(gsettings get org.gnome.desktop.input-sources xkb-options)
gsettings set org.gnome.desktop.input-sources xkb-options "[]"
gsettings set org.gnome.desktop.input-sources xkb-options "$save"

Put that in a file on your path and mark it executable. I named mine fbk for fix bluetooth keyboard. Then I do:

Alt+F2 fbk

I tried creating a udev rule to execute it automatically when my bluetooth keyboard gets connected, but that didn’t work because udev rules are executed by root not the user logged into the graphical session.

(If anyone knows how to fix this with a udev rule, please let me know.)

Bug filed: https://bugzilla.redhat.com/show_bug.cgi?id=1897877

hmmm, the keyboard itself gets into standby mode after one or two minutes of inactivity. If you use the unify receiver, the keyboard is virtually still connected, even if the keyboard isn’t turned on. That’s why the compose key is still working. But if you remove the USB Keyboard and plug it back in, it’s the same. So it seems that this has nothing to do with bluez, as you mentioned in your Bug report.

i think, it has something to do with gdm-x-session, as you can see in the logfile, it only sets the language, but no other options:

16 07:45:27 cprlpf26j8hg /usr/libexec/gdm-x-session[2033]: (II) libinput: Logitech MX Keys: is a virtual subdevice
Nov 16 07:45:27 cprlpf26j8hg /usr/libexec/gdm-x-session[2033]: (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4:1.2/0003:046D:C52B.0025/0003:046D:408A.0027/input/input62/event21"
Nov 16 07:45:27 cprlpf26j8hg /usr/libexec/gdm-x-session[2033]: (II) XINPUT: Adding extended input device "Logitech MX Keys" (type: KEYBOARD, id 20)
Nov 16 07:45:27 cprlpf26j8hg /usr/libexec/gdm-x-session[2033]: (**) Option "xkb_layout" "de"

I fixed it for my case with:

❯ sudo localectl set-x11-keymap us "" "" lv3:ralt_switch,compose:ralt

which is reflected in:

❯ cat /etc/X11/xorg.conf.d/00-keyboard.conf
# Written by systemd-localed(8), read by systemd-localed and Xorg. It's
# probably wise not to edit this file manually. Use localectl(1) to
# instruct systemd-localed to update it.
Section "InputClass"
        Identifier "system-keyboard"
        MatchIsKeyboard "on"
        Option "XkbLayout" "us"
        Option "XkbOptions" "lv3:ralt_switch,compose:ralt"
EndSection

and

❯ localectl status
   System Locale: LANG=en_US.UTF-8
       VC Keymap: us
      X11 Layout: us
     X11 Options: lv3:ralt_switch,compose:ralt

After a reboot, the binding of Right Alt to my compose key is persistent if I power-cycle my bluetooth keyboard. Tested on Fedora 32 (both X and Wayland).

Does something similar to that work for your keyboard?

Similar reports:

Debian bug report 763609: gnome-shell: keyboard layout switching ignored after unplug/plug USB keyboard

Layout switch when bluetooth keyboard unsleeps | Arch Linux Forums

Hi @robin217, thaks for this one.

Today, it stopped working on all Keyboards including the internal one. So i’ll try your fix ASAP. It looks promising.

it doesn’t fix my issue at all. sometimes it works, sometimes not…

and an additional issue has received my Notebook. With the latest Kernel (5.9.8) i can’t reconnect any Bluetooth devices. But it looks like this is a well-known issue.

Edit:
It looks like it takes a couple of seconds after login. i Started chromium, and it doesn’t work here. A few moments later, i tried it in textedit and it works. Switching back to chromium: Doesn’t work. I’ve closed chromium and restart it: it works™. i’ll watch at this in the next days…

Edit2:
Today i’ve had no luck, Bluetooth keyboard compose isn’t working , but USB Mode seems to work.