Project

General

Profile

Feature requests #514

Add an Input backend using SDL2 Gamepad

Added by isaboll1 over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Input
Start date:
05/02/2021
API:
Cemu Version:
GPU Vendor/Model:

Description

While Cemu currently has support for a variety of different input backends, each providing features that are very great and well for use (such as trigger rumble and 8-player querying with Window.Gaming.Input or motion through the DSU Client), many of these backends seem to provide features either under certain conditions (such as requiring a special device driver in the case of the DSU API's), work for specific input devices, or are limited in scope of the platform supported. If Cemu were to have a backend that uses SDL 2.0.14 specifically for it's Gamepad API, there would be a backend that can provide access to all of those features, and even more features can be made available, than what the other backend are capable of doing.

An SDL2 Gamepad backend would allow for a consistent and (platform/device)-agnostic controller implementation that can support 8-player input, trigger rumble, motion support for PS4/PS5 and Nintendo Switch Controllers/Joy-Cons (without requiring a DSU Motion Driver installed), allow for PS4/PS5 controller Touchpad input to be queried, allow for paddle input to also be queried (for Xbox-Elite controllers), and would allow for Steam Controllers to be queried and used directly (although obviously Steam presents an issue with Cemu if shader pre-caching is on). It would also allow for a backend that's can be shared with a Linux Native build, once the time comes for that.

while I haven't found many examples of SDL Gamepad being used with other emulators (most seem to use the older SDL_Joystick), I have created an application that serves as an example of how the API can be used to query and support each of the features I listed above, found here: https://github.com/isaboll1/SDL2-Gamepad-Example (and I give full permission to copy or modify the format of the "sdl_gamepad.h" header that I created in that project)
there is also the app created by the SDL2 maintainers which serves as examples of using the library, which is included with the source of the library: https://github.com/libsdl-org/SDL/blob/main/test/testgamecontroller.c

History

#1

Updated by isaboll1 over 3 years ago

I referred to it as SDL2 Gamepad, but it's actually referred to as SDL_GameController. My bad.

#2

Updated by Exzap over 3 years ago

  • Status changed from New to Closed

Implemented in Cemu 1.24.0
Thanks for the suggestion!

Also available in: Atom PDF