jgeumlek / MoltenGamepad

Flexible Linux input device translator, geared for gamepads
MIT License
280 stars 42 forks source link

Classic controller mapping issue #2 (analog buttons) #95

Open madsl opened 3 years ago

madsl commented 3 years ago

I left some comments in issue #38 that I still haven't figured out - why does moltengamepad not work with my wiimote classic controller with analog shoulder buttons?

Original comment from #38: I have some classic controllers that seems to give analogue values when I test with evtest, but I cannot get anything registering within MoltenGamepad after unsetting cc_r and cc_l and setting cc_l_axis and r_axis to tl2/tr2_axis

Output from moltengamepad startup: ...

parse: setting wiimote.cc_l_axis = tl2_axis+
parse: setting wiimote.cc_r_axis = tr2_axis+

...

But nothing happens in moltengamepad (after move wm1 to debugslot) when I press the buttons.

Here's output from evtest when doing a quick press on the right shoulder key (when not running moltengamepad):

Event: time 1601131800.637029, type 3 (EV_ABS), code 22 (ABS_HAT3X), value 34
Event: time 1601131800.637029, -------------- SYN_REPORT ------------
Event: time 1601131800.653275, type 3 (EV_ABS), code 22 (ABS_HAT3X), value 38
Event: time 1601131800.653275, -------------- SYN_REPORT ------------
Event: time 1601131800.673310, type 3 (EV_ABS), code 22 (ABS_HAT3X), value 54
Event: time 1601131800.673310, type 1 (EV_KEY), code 311 (BTN_TR), value 1
Event: time 1601131800.673310, -------------- SYN_REPORT ------------
Event: time 1601131800.721957, type 3 (EV_ABS), code 22 (ABS_HAT3X), value 56
Event: time 1601131800.721957, -------------- SYN_REPORT ------------
Event: time 1601131800.932076, type 3 (EV_ABS), code 22 (ABS_HAT3X), value 54
Event: time 1601131800.932076, type 1 (EV_KEY), code 311 (BTN_TR), value 0
Event: time 1601131800.932076, -------------- SYN_REPORT ------------
Event: time 1601131800.942060, type 3 (EV_ABS), code 22 (ABS_HAT3X), value 40
Event: time 1601131800.942060, -------------- SYN_REPORT ------------
Event: time 1601131800.952052, type 3 (EV_ABS), code 22 (ABS_HAT3X), value 34
Event: time 1601131800.952052, -------------- SYN_REPORT ------------
Event: time 1601131800.962038, type 3 (EV_ABS), code 22 (ABS_HAT3X), value 18
Event: time 1601131800.962038, -------------- SYN_REPORT ------------
Event: time 1601131800.969604, type 3 (EV_ABS), code 22 (ABS_HAT3X), value 6
Event: time 1601131800.969604, -------------- SYN_REPORT ------------
Event: time 1601131800.980910, type 3 (EV_ABS), code 22 (ABS_HAT3X), value 4
Event: time 1601131800.980910, -------------- SYN_REPORT ------------

Would be extremely neat to have this working :) Is there some debug tricks I can apply to figure out what is going wrong? This is tested today on commit 95b0d47 (with make eventlists)

madsl commented 1 year ago

No news regarding MoltenGamepad and this issue, but I thought I should mention that the built-in Steam Input support in Steam has gotten good enough these last years that MoltenGamepad might not be strictly needed anymore (although it would be nice to have working too, as it makes things a lot simpler).

I found a configuration string that made the Classic Controller analog buttons work in Steam alone, I wrote about it here: https://github.com/ValveSoftware/steam-for-linux/issues/9962

It should be mentioned that you also have to calibrate the gamepad when you use Steam Only, you can use this program for that: https://github.com/Virusmater/evdev-joystick-calibration