citra/src/input_common
Vitor K ce16653cc8
Automatic Controller Binding (#5100)
* Implement the basics of controller auto mapping. From testing doesn't currenlty work.
Opening the controller requires the device index, but it is only known and guaranteed
at boot time or when a controller is connected.

* Use the SDL_INIT_GAMECONTROLLER flag to initialize the controller
subsystem. It automatically initializes the joystick subsystem too,
so SDL_INIT_JOYSTICK is not needed.

* Implement the SDLGameController class to handle open game controllers.
Based on the SDLJoystick implementation.

* Address review comments

* Changes SDLJoystick and SDLGameController to use a custom default
constructible destructor, to improve readability. The only deleters
used previously were SDL_JoystickClose and SDL_GameControllerClose,
respectively, plus null lambdas. Given that both SDL functions
accept null pointers with just an early return, this should be
functionally the same.
with just an early return

* warn the user when a controller mapping is not found

* Get axis direction and threshold from SDL_ExtendedGameControllerBind

* Reject analog bind if it's not axis, for the couple of examples present in SDL2.0.10's db.
Also add SDL_CONTROLLER_BINDTYPE_NONE for the button bind switch, with a better log message.

* sdl_impl.cpp: Log the error returned by SDL_GetError upon failure to open joystick

* sdl: only use extended binding on SDL2.0.6 and up

* sdl_impl.cpp: minor changes
2021-01-01 10:01:07 +01:00
..
sdl Automatic Controller Binding (#5100) 2021-01-01 10:01:07 +01:00
udp udp/client: Take std::function by const reference with TestCommunication() 2020-12-05 23:07:08 +01:00
analog_from_button.cpp InputCommon: add AnalogFromButton 2017-03-01 23:30:57 +02:00
analog_from_button.h InputCommon: add AnalogFromButton 2017-03-01 23:30:57 +02:00
CMakeLists.txt input_common: add TouchFromButtonDevice 2020-05-04 13:51:37 +03:00
keyboard.cpp Keep keyboard state independent of acquired buttons (#5255) 2020-11-15 12:58:12 +01:00
keyboard.h citra-qt: release all buttons when render window focus is lost 2017-03-17 21:41:25 +02:00
main.cpp Automatic Controller Binding (#5100) 2021-01-01 10:01:07 +01:00
main.h Automatic Controller Binding (#5100) 2021-01-01 10:01:07 +01:00
motion_emu.cpp general: Use deducation guides for std::lock_guard and std::unique_lock 2019-04-07 15:14:29 +02:00
motion_emu.h motion_emu: no need to include thread in header 2017-08-19 07:21:02 +03:00
touch_from_button.cpp input_common: add TouchFromButtonDevice 2020-05-04 13:51:37 +03:00
touch_from_button.h input_common: add TouchFromButtonDevice 2020-05-04 13:51:37 +03:00