From 9664b5767995f6ecb65d9dc5f2df12aa081093c7 Mon Sep 17 00:00:00 2001 From: Seth Etter Date: Sat, 12 Sep 2026 07:51:25 -0500 Subject: [PATCH] debian: fix caps lock hwdb entry to scancode form The udev keyboard builtin only applies KEYBOARD_KEY_= properties; the KEY_CAPSLOCK form was silently ignored. Use 3a (AT/PS2 scancode) for atkbd and 70039 (HID usage) for USB/Bluetooth. Requires a reboot to apply. --- debian/ansible/setup.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/debian/ansible/setup.yml b/debian/ansible/setup.yml index 19a2673..a706f12 100644 --- a/debian/ansible/setup.yml +++ b/debian/ansible/setup.yml @@ -268,16 +268,23 @@ # Caps lock -> ctrl at the kernel level: GNOME on Wayland was not # applying gsettings xkb-options (values correct, gsd-keyboard running, # mutter keymap unchanged), so remap the keycode where every session — - # Wayland, X11, GDM, TTY — sees it. Covers built-in, USB, Bluetooth. + # Wayland, X11, GDM, TTY — sees it. The udev keyboard builtin only honors + # KEYBOARD_KEY_= entries: 3a is the AT/PS2 scancode for + # caps lock, 70039 the HID usage (USB/Bluetooth). Requires a reboot to + # apply; udevadm trigger is not reliable for keycode remaps. - name: Map caps lock to ctrl at the kernel level ansible.builtin.copy: dest: /etc/udev/hwdb.d/61-capslock-ctrl.hwdb mode: "0644" content: | evdev:atkbd:dmi:* + KEYBOARD_KEY_3a=leftctrl + evdev:input:b0003* + KEYBOARD_KEY_70039=leftctrl + evdev:input:b0005* - KEY_CAPSLOCK=leftctrl + KEYBOARD_KEY_70039=leftctrl register: capslock_hwdb become: true -- 2.51.2