I need help on Caps Lock behavior in Wayland/GNOME

on X11 I was able to get immediate behavior through XKB, but on Wayland I can’t reproduce it. Is there any way to achieve this?

I’m running Ubuntu 26.04 LTS with GNOME 50.1 on Wayland and I don’t want the following behavior:

Press Caps Lock → LED turns on and activates immediately.
Press it again → the LED only turns off when the key is released.

Aa = AA x_x

I don’t know how that works. I assume what you want is to have a script running once a button is clicked, or…?

I meant that I want the Caps Lock to behave immediately on press, like it did on X11 with XKB, instead of the “delayed” behavior where the LED only turns off when the key is released.

I posted it on askubuntu and had a brief solution! I appreciate the help! https://askubuntu.com/q/1566026/2457913

Just a note: XKB is used by Wayland compositors as well: XKB is a shared component under both X11 and Wayland sessions.