Weird usb keyboard behavior

I have two usb keyboards, one works perfectly while another (a Gamdias “Kworld Gaming Keyboard”) is quite weird: no keyboard event is detected by system until I read from its hidraw device (meaning cat /dev/hidraw{someNumber} > /dev/null).
Actually, three new hidraw devices appear under /dev when the keyboard is plugged in, usually /dev/hidraw3, /dev/hidraw4 and /dev/hidraw5 in my system, but only one of them (though their path can change any time) can be used in the above cat command to bring life to the keyboard.

This thing is surely not nixos specific, but I hope someone can shed some light here…

I gave it a quick duck, this came up: How do I get a non-linux keyboard to work in Linux? : linuxquestions

The first set of comments make sense to me, and it matches your symptoms of it suddenly working again once you cause the kernel to poll the hid-generic interface. I’d figure out how to blacklist stuff without using a random gui thing, or just some way to auto-poll the generic interface. You can probably do it with udev rules?

If you do figure it out, add a module to nixos-hardware, and perhaps comment on that reddit post while you’re at it :wink:

The other option is to write a driver for it yourself. Probably worth searching the kernel ML history for that company’s name, too. Either way, that’s some very evil keyboard behavior, I’ll make sure to stay away from Gamdias.