Open PPakalns opened 3 years ago
Any suggestion how to solve this? Should we add a option for the mapping file to the application settings?
One possible solution:
SDL_GAMECONTROLLERCONFIG
environment variable value could be read and passed to
https://wiki.libsdl.org/SDL_GameControllerAddMapping function after
configuration from hardcoded file is loaded so that it overrides hardcoded configuration.
https://github.com/mavlink/qgroundcontrol/blob/master/src/Joystick/JoystickSDL.cc#L111
Similar to what is done with the hardcoded configuration. I would do it myself but have problems with setting up Qt5 for compiling QGroundControl by myself.
This would be very handy to map input from USB connected RC controls like the Radiomaster TX16S or Taranis X9D. Currently the axis cannot properly used via QGC.
Expected Behavior
Joystick axis, buttons can be correctly configured and recognized by SDL library.
Joystick GameController configuration environment variable
SDL_GAMECONTROLLERCONFIG
must be correctly processed with the highest priority.Current Behavior
Mapping from the SDL_GAMECONTROLLERCONFIG are not recognized.
It could be possible that the loading of GameController mappings from file hardcoded in compilation process overrides value set in SDL_GAMECONTROLLERCONFIG when SDL is initialized with SDL_INIT_GAMECONTROLLER flag.
See: https://github.com/mavlink/qgroundcontrol/blob/master/src/Joystick/JoystickSDL.cc#L99
Steps to Reproduce:
Please provide an unambiguous set of steps to reproduce the current behavior
System Information
When posting bug reports, include the following information