| Summary: | SDL2 sending multiple events (keyboard and gamepad) at the same time | ||
|---|---|---|---|
| Product: | SDL | Reporter: | George McMullen <spam-g-libsdl> |
| Component: | events | Assignee: | Sam Lantinga <slouken> |
| Status: | NEW --- | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | glex.spb |
| Version: | 2.0.13 | ||
| Hardware: | ARM | ||
| OS: | Linux | ||
|
Description
George McMullen
2020-03-24 21:47:01 UTC
I've recently tried to update SDL2 for RG350 (a handheld gaming device) from 2.0.0 to master and saw the same issue. Thanks George for tracking it down to a particular commit, I'll see if reverting it helps me as well. Reverting that patch didn't solve the issue for me but my setup is different. RG350 linux kernel has a custom kernel "device" that handles mode switching (between kb and joystick) and merging the inputs from the 2 hardware inputs into 1. The other slight difference in my issue is that I get unexpected keyboard keys in joystick mode (along with the joystick buttons). The original issue is about getting unexpected joystick keys in keyboard mode. Hi Gleb, That's a cool device! So, you've got a Linux kernel running on it which previously had SDL 2.0.0? If you compile SDL 2.0.0 yourself, do you still not have the error? It might also be helpful to figure out what subsystem is receiving the joystick commands, it could be SYS or even X11. That might help narrow down where to look. For me, I basically did a binary search across major versions, then drilled into the commits between the previous working and next non-working version, via binary search again. I believe I used the suggestion from this StackOverflow post to get the list of commits between versions. https://stackoverflow.com/questions/5863426/get-commit-list-between-tags-in-git It took a while, because I was doing it all manually. I hope that helps you. PS: Noticed this issue/feature request that may be related. https://bugzilla.libsdl.org/show_bug.cgi?id=4955 Apologies for the late reply! The entire system is built from source. The buildroot is here https://github.com/od-contrib/buildroot-rg350-old-kernel (updated SDL2 is in the `upd-sdl2` branch) The custom Linux kernel driver that handles merging and mode switching is here: https://github.com/tonyjih/RG350_linux/blob/master/drivers/input/linkdev.c (it's a rather old kernel) There is no X11 on it at all so I don't think it's that. The related feature request (4955) is so that we can avoid doing it in the kernel (linkdev.c) but that's a long way away Thanks for the additional information Gleb. I think that the problems presented with the ATmega32U4 and RG350 could be related. Unless of course the linkdev kernel driver isn't somehow preventing the native devices from being read by SDL and somehow SDL is picking up on multiple events. I didn't do an extensive run of all the events that the ATmega32U4 can produce, only showing that the gamepad events I tested also sent mouse events. Do you have any event logs from the RG350's game pad? I'd like to see which game pad events and key events are firing. Since the ATmega32U4 is programmable, perhaps I can replicate those events and see if I get the same response. The feature request in 4955 seems to be the way these issues will be fixed long term though, either by being able to address multiple devices within a single map, or for a map to be able to have multiple "sub-maps". |