TL;DR is that I have a fancy gaming mouse that I want to disable some of the features of but not all, and it's tricky to pinpoint them. I'm using
SUBSYSTEM=="input",ATTRS{serial}=="SZH410946",ACTION=="add",ENV{DEVLINK}=="/dev/input/by-id/usb-Swiftpoint_Limited_Swiftpoint_Z_SZH410946-if02-joystick",MODE="0000"
but it's not getting the 000 part.
The long version. I have a Swiftpoint Z mouse that I'm pretty fond of. It's a gaming mouse with all kinds of buttons, gyros, etc. in it. Sadly, like too many things, it seems like Linux support is off the table for the devs of it, but I can configure it in Win-blows and save the config to onboard storage on the mouse. This works great, for most things.
The actual problem I'm trying to solve is that in order to work, the mouse emulates a keyboard, mouse, and joystick, over a number of devices. The joystick in particular is causing me the grief. Quite a few of my games pick it up and treat it at controller 1, and several of the axis on this fake device are pegged, causing all kinds of mayham. I have learned to look at the device that it gets set to and just sudo rm /dev/input/js**x**
, etc. but that's pretty tedious after each reboot, and I like learning new things, so I set about learning udev.
So the first issue, is that not much identifies the joystick and event devices from say, the mouse or keyboard part. I've been trying to isolate it with ENV{DEVLINK}=="path/to/device"
and I think it's matching, at least when I run sudo udevadm test blah blah
it seems to get it. But my MODE="0000"
doesn't seem to want to work right. I also tried RUN+="/usr/bin/rm `readlink -f /path/to/dev`"
which also seemed to do nothing.
Another thing I noticed, is before I had the ENV{DEVLINK}=="path/to/device"
part, is that it would blow away the joystick (along with the rest of my mouse) but only with the udevadm test
command. Simply plugging the device in did nothing.
I have been thinking of just running a script with it that can do the rm
for me, but... eh... it feels less clean than just learning what I'm doing wrong and fixing it. Any help is appreciated.
0 Answers