You are not logged in.

#1 Yesterday 21:28:14

tjdeamon
Member
Registered: Yesterday
Posts: 1

[SOLVED] CASUE USB Keyboard (2A7A:939F) Backlight Not Working on Arch

I wanted to share this because this issue drove me crazy for almost two days, and despite searching everywhere, I couldn't find anyone with the exact same problem. Hopefully this saves someone else the time I spent troubleshooting.

System
* Arch Linux
* KDE Plasma 6.7.3
* X11
* CASUE USB Keyboard (USB ID: `2A7A:939F`)

On Windows, the keyboard's white backlight worked normally. It would usually turn on automatically after boot, and pressing the SL (Scroll Lock) key toggled the backlight on and off.
After switching to Arch , the keyboard itself worked perfectly, but the backlight never came on. Caps Lock and Num Lock LEDs worked fine, so I initially assumed Linux simply didn't support the keyboard.
I started by checking whether Linux was even detecting the keyboard. `lsusb` showed the device correctly, and `evtest` confirmed that the kernel was receiving Scroll Lock, Caps Lock and Num Lock key presses. So the keyboard and its HID driver were working as expected.
Next, I checked the LED subsystem under `/sys/class/leds/` and found entries for the CASUE keyboard, including `input34::scrolllock`. Out of curiosity, I manually enabled the Scroll Lock LED:

```bash
echo 1 | sudo tee /sys/class/leds/input34::scrolllock/brightness
```

To my surprise, the keyboard backlight immediately turned on. That was the first clue that the backlight was actually controlled through the Scroll Lock LED.
However, the LED state immediately reset, so writing directly to `/sys/class/leds` wasn't a reliable solution.
Since I was using X11, I tried:

```bash
xset led named "Scroll Lock"
```

The backlight turned on perfectly.

Running:

```bash
xset -led named "Scroll Lock"
```

turned it off again.
At this point I knew the hardware wasn't the problem. Linux could control the backlight just fine.
Using `xev` confirmed that pressing the SL key generated a normal `Scroll_Lock` event, but for some reason pressing the key never changed X11's Scroll Lock state. In other words, the key press reached X11, but it didn't actually toggle the LED.
I wrote a small script that simply checks the current Scroll Lock state and toggles it using `xset`:

```bash
#!/bin/bash

if xset q | grep -q "Scroll Lock: on"; then
    xset -led named "Scroll Lock"
else
    xset led named "Scroll Lock"
fi
```

Running the script manually worked perfectly.
I then tried binding the script to the Scroll Lock key using KDE Plasma's global shortcuts, but that didn't work. Oddly enough, even assigning other shortcuts like `Ctrl+Y` wouldn't execute the script, so I stopped chasing KDE and looked for another solution.
The fix was installing xbindkeys:

```bash
sudo pacman -S xbindkeys
xbindkeys --defaults > ~/.xbindkeysrc
```

Then I added:

```text
"/home/<username>/bin/toggle-keyboard-light"
    Scroll_Lock
```

to `~/.xbindkeysrc`, restarted `xbindkeys`, and everything worked exactly as it did on Windows.

Now pressing the **SL** key turns the backlight on, and pressing it again turns it off.
The interesting part is that the keyboard was supported all along. The kernel detected it, the LED interface existed, and X11 could control it. The missing piece was simply binding the Scroll Lock key to the command that toggles the LED.
I hope this helps anyone else who ends up here after searching for CASUE keyboard backlight Linux,2A7A:939F, or Scroll Lock backlight on Arch Linux. It certainly would've saved me a lot of frustration.

Offline

Board footer

Powered by FluxBB