Prevent mouse and keyboard from being detected as joysticks

I’m playing a rather old game that only uses /dev/input/js0 for controller input. The developers of the game are aware of this, but a fix won’t happen for a long time.

My keyboard and mouse are detected as joysticks and immediately bound as js0 and js1 respectively. I would like for this to not happen, at all, ever.

I’m aware of denilsonsa/udev-joystick-blacklist, but that doesn’t prevent the devices from being bound as js0/js1 to begin with.

How can I accomplish this? It seems like this is a Linux kernel bug, though I’m not confident I can fix it myself (nor should I have to, it is a very old bug by now).

I’m continuing to look into this and it seems that js0 and js1 are being assigned by the hid_generic kernel module, if I’m understanding sysfs correctly.

I’ve also booted into a Fedora live USB and the same thing happens there. So it can’t be my software configuration (unless Fedora also has the same erroneous config, but I think that’s silly).

As a workaround for my specific case, I’ve went ahead and used `sudo mount –bind /dev/input/js2 /dev/input/js0` and the game now works until I reboot. But that’s definitely a rather dirty solution; the real solution would be to stop assigning my keyboard and mouse as joysticks somehow.