for the curious, a photo of the adapter (i don't remember where i got it, maybe from a brick-and-mortar gameshop?):
it's identified by my system as a mayflash adapter, so it should work for those too.
these udev rules use the arch packages joyutils and linuxconsole, which provide jscal and evdev-joystick respectively. non-arch systems will want to use some equivalent packages or utilities to configure deadzones.
and now, the udev rules in question:
Code: Select all
# file location: /etc/udev/rules.d/51-gcadapter.rules
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}=="0079", ATTRS{idProduct}=="1843", MODE="0666"
# set axis info for Hyperkin GameCube Adapter
ACTION=="add", ENV{ID_VENDOR_ID}=="0079", ENV{ID_MODEL_ID}=="1843", RUN+="/usr/bin/jscal -s 8,1,0,112,142,6795626,6032073,1,0,112,142,5899500,6972136,1,0,112,142,7254790,6468126,1,0,112,142,6468126,5534582,1,0,112,142,6882750,5534582,1,0,112,142,7254790,6972136,1,0,0,0,536854528,536854528,1,0,0,0,536854528,536854528 /dev/input/js%n"
ACTION=="add", KERNEL=="event*", SUBSYSTEM=="input", SUBSYSTEMS=="usb", ATTRS{idVendor}=="0079", ATTRS{idProduct}=="1843", RUN+="/usr/bin/evdev-joystick --evdev /dev/input/event%n --axis 0 --minimum 33 --maximum 231"
ACTION=="add", KERNEL=="event*", SUBSYSTEM=="input", SUBSYSTEMS=="usb", ATTRS{idVendor}=="0079", ATTRS{idProduct}=="1843", RUN+="/usr/bin/evdev-joystick --evdev /dev/input/event%n --axis 1 --minimum 19 --maximum 223"
ACTION=="add", KERNEL=="event*", SUBSYSTEM=="input", SUBSYSTEMS=="usb", ATTRS{idVendor}=="0079", ATTRS{idProduct}=="1843", RUN+="/usr/bin/evdev-joystick --evdev /dev/input/event%n --axis 2 --minimum 37 --maximum 226"
ACTION=="add", KERNEL=="event*", SUBSYSTEM=="input", SUBSYSTEMS=="usb", ATTRS{idVendor}=="0079", ATTRS{idProduct}=="1843", RUN+="/usr/bin/evdev-joystick --evdev /dev/input/event%n --axis 3 --minimum 27 --maximum 243"
ACTION=="add", KERNEL=="event*", SUBSYSTEM=="input", SUBSYSTEMS=="usb", ATTRS{idVendor}=="0079", ATTRS{idProduct}=="1843", RUN+="/usr/bin/evdev-joystick --evdev /dev/input/event%n --axis 4 --minimum 29 --maximum 241"
ACTION=="add", KERNEL=="event*", SUBSYSTEM=="input", SUBSYSTEMS=="usb", ATTRS{idVendor}=="0079", ATTRS{idProduct}=="1843", RUN+="/usr/bin/evdev-joystick --evdev /dev/input/event%n --axis 5 --minimum 37 --maximum 220"
also see udev on archwiki.
i hope this helps anyone who wants to use gamecube controllers on linux!