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