I am trying to read a DirectInput Device under Linux.
lsusb:
Bus 003 Device 006: ID 046d:c219 Logitech, Inc. F710 Gamepad [DirectInput Mode]
sudo dmesg:
[13919.233231] usb 3-2.2: new full-speed USB device number 15 using xhci_hcd
[13919.335587] usb 3-2.2: New USB device found, idVendor=046d, idProduct=c219, bcdDevice= 3.05
[13919.335598] usb 3-2.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[13919.335603] usb 3-2.2: Product: 游戏手柄
[13919.335607] usb 3-2.2: Manufacturer: game
[13919.421920] input: game 游戏手柄 as /devices/pci0000:00/0000:00:07.1/0000:0a:00.3/usb3/3-2/3-2.2/3-2.2:1.0/0003:046D:C219.000E/input/input32
[13919.422147] logitech 0003:046D:C219.000E: input,hidraw8: USB HID v1.10 Gamepad [game 游戏手柄] on usb-0000:0a:00.3-2.2/input0
[13919.422154] logitech 0003:046D:C219.000E: missing HID_OUTPUT_REPORT 0
ls /dev/ | grep hid:
hidraw0
hidraw1
hidraw2
hidraw3
hidraw4
hidraw5
hidraw6
hidraw7
uhid
Only goes up to 7, not 8 :(
udevadm monitor when plugging in:
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent
KERNEL[4618.774609] add /devices/pci0000:00/0000:00:07.1/0000:0a:00.3/usb3/3-2/3-2.3 (usb)
KERNEL[4618.859136] add /devices/pci0000:00/0000:00:07.1/0000:0a:00.3/usb3/3-2/3-2.3/3-2.3:1.0 (usb)
KERNEL[4618.860049] add /devices/pci0000:00/0000:00:07.1/0000:0a:00.3/usb3/3-2/3-2.3/3-2.3:1.0/0003:046D:C219.000C (hid)
KERNEL[4618.860281] add /devices/pci0000:00/0000:00:07.1/0000:0a:00.3/usb3/3-2/3-2.3/3-2.3:1.0/0003:046D:C219.000C/input/input30 (input)
KERNEL[4618.860397] add /devices/pci0000:00/0000:00:07.1/0000:0a:00.3/usb3/3-2/3-2.3/3-2.3:1.0/0003:046D:C219.000C/input/input30/event27 (input)
KERNEL[4618.860480] add /devices/pci0000:00/0000:00:07.1/0000:0a:00.3/usb3/3-2/3-2.3/3-2.3:1.0/0003:046D:C219.000C/input/input30/js0 (input)
KERNEL[4618.860567] add /devices/pci0000:00/0000:00:07.1/0000:0a:00.3/usb3/3-2/3-2.3/3-2.3:1.0/0003:046D:C219.000C/hidraw/hidraw8 (hidraw)
KERNEL[4618.860674] remove /devices/pci0000:00/0000:00:07.1/0000:0a:00.3/usb3/3-2/3-2.3/3-2.3:1.0/0003:046D:C219.000C/input/input30/event27 (input)
KERNEL[4618.870216] remove /devices/pci0000:00/0000:00:07.1/0000:0a:00.3/usb3/3-2/3-2.3/3-2.3:1.0/0003:046D:C219.000C/input/input30/js0 (input)
KERNEL[4618.887225] remove /devices/pci0000:00/0000:00:07.1/0000:0a:00.3/usb3/3-2/3-2.3/3-2.3:1.0/0003:046D:C219.000C/input/input30 (input)
KERNEL[4618.887338] remove /devices/pci0000:00/0000:00:07.1/0000:0a:00.3/usb3/3-2/3-2.3/3-2.3:1.0/0003:046D:C219.000C/hidraw/hidraw8 (hidraw)
KERNEL[4618.887408] bind /devices/pci0000:00/0000:00:07.1/0000:0a:00.3/usb3/3-2/3-2.3/3-2.3:1.0 (usb)
KERNEL[4618.887507] bind /devices/pci0000:00/0000:00:07.1/0000:0a:00.3/usb3/3-2/3-2.3 (usb)
UDEV [4618.900197] add /devices/pci0000:00/0000:00:07.1/0000:0a:00.3/usb3/3-2/3-2.3 (usb)
UDEV [4618.906487] add /devices/pci0000:00/0000:00:07.1/0000:0a:00.3/usb3/3-2/3-2.3/3-2.3:1.0 (usb)
UDEV [4618.910584] add /devices/pci0000:00/0000:00:07.1/0000:0a:00.3/usb3/3-2/3-2.3/3-2.3:1.0/0003:046D:C219.000C (hid)
UDEV [4618.917739] add /devices/pci0000:00/0000:00:07.1/0000:0a:00.3/usb3/3-2/3-2.3/3-2.3:1.0/0003:046D:C219.000C/hidraw/hidraw8 (hidraw)
UDEV [4618.919709] remove /devices/pci0000:00/0000:00:07.1/0000:0a:00.3/usb3/3-2/3-2.3/3-2.3:1.0/0003:046D:C219.000C/hidraw/hidraw8 (hidraw)
UDEV [4619.219420] add /devices/pci0000:00/0000:00:07.1/0000:0a:00.3/usb3/3-2/3-2.3/3-2.3:1.0/0003:046D:C219.000C/input/input30 (input)
UDEV [4620.095442] add /devices/pci0000:00/0000:00:07.1/0000:0a:00.3/usb3/3-2/3-2.3/3-2.3:1.0/0003:046D:C219.000C/input/input30/js0 (input)
UDEV [4620.109143] remove /devices/pci0000:00/0000:00:07.1/0000:0a:00.3/usb3/3-2/3-2.3/3-2.3:1.0/0003:046D:C219.000C/input/input30/js0 (input)
UDEV [4620.129855] add /devices/pci0000:00/0000:00:07.1/0000:0a:00.3/usb3/3-2/3-2.3/3-2.3:1.0/0003:046D:C219.000C/input/input30/event27 (input)
UDEV [4620.132286] remove /devices/pci0000:00/0000:00:07.1/0000:0a:00.3/usb3/3-2/3-2.3/3-2.3:1.0/0003:046D:C219.000C/input/input30/event27 (input)
UDEV [4620.134369] remove /devices/pci0000:00/0000:00:07.1/0000:0a:00.3/usb3/3-2/3-2.3/3-2.3:1.0/0003:046D:C219.000C/input/input30 (input)
UDEV [4620.142158] bind /devices/pci0000:00/0000:00:07.1/0000:0a:00.3/usb3/3-2/3-2.3/3-2.3:1.0 (usb)
UDEV [4620.152604] bind /devices/pci0000:00/0000:00:07.1/0000:0a:00.3/usb3/3-2/3-2.3 (usb)
But sadly no joystick or event is bound :(
How to work around this? Is a custom Windows DirectX Input Driver implementation needed?
hidraw0.hidraw8in theudevadm monitoroutput though. No idea how that is related to the dev nodes though. (Does it mean/dev/hidraw7?)