custom uinput device : events are not received by SDL ?! |
jit
|
Hello,
I'm facing a problem since a few days and I can't manage to correct it... I hope that this forum is the good one. I'm using an odroid C1 (http://www.hardkernel.com/main/products/prdt_info.php?g_code=G143703355573) for a portable gaming system. I created a small program that simulates a gamepad using GPIO and uinput. My program creates standard linux input devices (/dev/input/event3 and /dev/input/js0) and works correctly with non SDL softwares (eg: hurrican, astromenace, etc.). Another proof that it works correctly is that I had to add the following lines in my Xorg.conf to avoid my "virtual" gamepad's analog stick to move the mouse cursor:
But for all SDL based applications (eg: rvgl, testing tools like controllerpad), the gamepad is well seen by applications, but when I select it, it does nothing (eg: no event received). Something more strange is that with the official SDL testing tools (tests/controllerpad.c), when I launch it, I can select my gamepad (eg: "controllerpad 0"), the program give all gamepad infos (2 axis, 11 buttons), but the program react on keyboard and mouse event and not on my gamepad events ! I'm a debian jessie, SDL2 under Xorg, and I also have a touchscreen and wireless keyboard + mouse plugged througt usb ports. My first impression is that there could be something with Xorg that do some routing with events... or some udev rules...or somehting even simpler to activate with SDL... ? Here is what udevadm give with my "virtual" gamepad activated :
Any suggestion and help would be greatly appreciated ! [/url][/code] |
|||||||||||||||
|
jit
|
I just tried another SDL joystick test tool :sdl2-jstest from https://github.com/Grumbel/sdl-jstest
the output of sdl2-jstest -l is :
when I use the display event mode (sdl2-jstest -e 0), I can see every axis and buttons responding correctly... I still not understand why games are not receiving events from my controller |
|||||||||||||
|
jit
|
Problem resolved ! I had to run a windows manager (eg: blackbox) (I only had a xterm to launch commands)
|
|||||||||||
|