Hi!
Thx for the property hint (ID_INPUT_JOYSTICK). Wiimotes do not have this variable set. I forced it with this udev rule:
SUBSYSTEM==“input”, ATTRS{name}==“Nintendo Wii Remote Classic Controller”, MODE=“666”, ENV{ID_INPUT_JOYSTICK}=“1”
And a quick look to see if it works:
xbmc@ZBOX:~/.config/retroarch/joypad$ udevadm info /dev/input/event15
P: /devices/pci0000:00/0000:00:13.0/usb4/4-2/4-2:1.0/bluetooth/hci0/hci0:1/0005:057E:0306.0004/input/input18/event15
N: input/event15
E: DEVNAME=/dev/input/event15
E: DEVPATH=/devices/pci0000:00/0000:00:13.0/usb4/4-2/4-2:1.0/bluetooth/hci0/hci0:1/0005:057E:0306.0004/input/input18/event15
E: ID_INPUT=1
E: ID_INPUT_JOYSTICK=1
E: ID_INPUT_KEY=1
E: MAJOR=13
E: MINOR=79
E: SUBSYSTEM=input
E: USEC_INITIALIZED=798811
E: XKBLAYOUT=de
E: XKBMODEL=pc105
However now I’m back to square one, the dpad doesn’t get recognized… evtest finds them with KEY_LEFT etc. retroarch-joyconfig gets every other button and axis.
xbmc@ZBOX:~$ evtest
No device specified, trying to scan all of /dev/input/event*
Not running as root, no devices may be available.
Available devices:
/dev/input/event15: Nintendo Wii Remote Classic Controller
Select the device event number [0-15]: 15
Input driver version is 1.0.1
Input device ID: bus 0x5 vendor 0x57e product 0x306 version 0x3a16
Input device name: "Nintendo Wii Remote Classic Controller"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 103 (KEY_UP)
Event code 105 (KEY_LEFT)
Event code 106 (KEY_RIGHT)
Event code 108 (KEY_DOWN)
Event code 304 (BTN_A)
Event code 305 (BTN_B)
Event code 307 (BTN_X)
Event code 308 (BTN_Y)
Event code 310 (BTN_TL)
Event code 311 (BTN_TR)
Event code 312 (BTN_TL2)
Event code 313 (BTN_TR2)
Event code 316 (BTN_MODE)
Event code 407 (KEY_NEXT)
Event code 412 (KEY_PREVIOUS)
Event type 3 (EV_ABS)
Event code 18 (ABS_HAT1X)
Value 0
Min -30
Max 30
Fuzz 1
Flat 1
Event code 19 (ABS_HAT1Y)
Value 0
Min -30
Max 30
Fuzz 1
Flat 1
Event code 20 (ABS_HAT2X)
Value 0
Min -30
Max 30
Fuzz 1
Flat 1
Event code 21 (ABS_HAT2Y)
Value -2
Min -30
Max 30
Fuzz 1
Flat 1
Event code 22 (ABS_HAT3X)
Value 4
Min -30
Max 30
Fuzz 1
Flat 1
Event code 23 (ABS_HAT3Y)
Value 2
Min -30
Max 30
Fuzz 1
Flat 1
Properties:
Testing ... (interrupt to exit)
Event: time 1392744333.812144, type 1 (EV_KEY), code 103 (KEY_UP), value 1
Event: time 1392744333.812144, -------------- SYN_REPORT ------------
Event: time 1392744333.908255, type 1 (EV_KEY), code 103 (KEY_UP), value 0
Event: time 1392744333.908255, -------------- SYN_REPORT ------------
Event: time 1392744334.405252, type 1 (EV_KEY), code 106 (KEY_RIGHT), value 1
Event: time 1392744334.405252, -------------- SYN_REPORT ------------
Event: time 1392744334.473147, type 1 (EV_KEY), code 106 (KEY_RIGHT), value 0
Event: time 1392744334.473147, -------------- SYN_REPORT ------------
Event: time 1392744334.910260, type 1 (EV_KEY), code 108 (KEY_DOWN), value 1
Event: time 1392744334.910260, -------------- SYN_REPORT ------------
Event: time 1392744335.095141, type 1 (EV_KEY), code 108 (KEY_DOWN), value 0
Event: time 1392744335.095141, -------------- SYN_REPORT ------------
Event: time 1392744335.441261, type 1 (EV_KEY), code 105 (KEY_LEFT), value 1
Event: time 1392744335.441261, -------------- SYN_REPORT ------------
Event: time 1392744335.557251, type 1 (EV_KEY), code 105 (KEY_LEFT), value 0
Event: time 1392744335.557251, -------------- SYN_REPORT ------------
Event: time 1392744338.869268, type 1 (EV_KEY), code 305 (BTN_B), value 1
Event: time 1392744338.869268, -------------- SYN_REPORT ------------
Event: time 1392744338.937243, type 1 (EV_KEY), code 305 (BTN_B), value 0
Event: time 1392744338.937243, -------------- SYN_REPORT ------------
Event: time 1392744341.116263, type 1 (EV_KEY), code 304 (BTN_A), value 1
Event: time 1392744341.116263, -------------- SYN_REPORT ------------
Event: time 1392744341.222255, type 1 (EV_KEY), code 304 (BTN_A), value 0
Event: time 1392744341.222255, -------------- SYN_REPORT ------------
Event: time 1392744341.449246, type 1 (EV_KEY), code 307 (BTN_X), value 1
Event: time 1392744341.449246, -------------- SYN_REPORT ------------
Event: time 1392744341.539297, type 1 (EV_KEY), code 307 (BTN_X), value 0
Event: time 1392744341.539297, -------------- SYN_REPORT ------------
Event: time 1392744341.808251, type 1 (EV_KEY), code 308 (BTN_Y), value 1
Event: time 1392744341.808251, -------------- SYN_REPORT ------------
Event: time 1392744341.889150, type 1 (EV_KEY), code 308 (BTN_Y), value 0
Event: time 1392744341.889150, -------------- SYN_REPORT ------------
As proof that the right driver and device were selected:
xbmc@ZBOX:~$ retroarch-joyconfig
Found joypad driver: udev
Using joypad: Nintendo Wii Remote Classic Controller
Joypads tend to have stale state after opened.
I hope someone can give me the next hint to whats wrong.
Thx everone!
Edit: I browsed though the source a little bit and found this in udev_joypad.c:
switch (events[i].type)
{
case EV_KEY:
if (code >= BTN_MISC)
pad->buttons[pad->button_bind
] = events[i].value;
break;
I guess that means that each keypress code < 265 (BTN_MISC) gets ignored? (Probably to filter out standard keyboard codes.) But why?
I'll try to compile retroarch without that check tomorrow and report back!