Gamepad Improvements

* Cleanup: Alignment, long lines, Replace 0 with SDLK_UNKNOWN

* Gamecontroller api analogue input

* Added some button handling

* Added mapping for other buttons

* Added trigger events

* Added force_joystick flag

* Removed force_joystick flag

Rationale:
1. It was actually broken lol
2. I cannot think of a case where enabling this would be a useful thing for
gzdoom. If the user is using a gamecontroller, it is pointless. If they are
not using a gamecontroller, it will just default to using the joystick api.
If they are not using a gamecontroller, but SDL thinks they are, it is an
SDL bug, and will be reported and fixed

* Modified default mapping

* Added analogue to digital threshold

* Added analogue response curve

* Per axis settings

* Fixed controller reconnect

* Added threshold and curve to IJoystickConfig
Enabled saving of settings

* Added stubs

* Cleanup

Constants are no longer defines.
Constants are mostly shared between backends.
Moved some logic to m_joy

* Implemented xinput stubs

* Implemented dinput stubs

* Implemented ps2 stubs (untested)

* Fixed inclusive check

* Implemented osx stubs (untested)

* Fixed curve implementation

No longer savable, I screwed the curve function up.
I though it needed 2 control points, but it needs 4.
Need to re-do controller settings :(

* Now using CubicBezier struct

* Fixed SetDefaultConfig to match xinput behavior

* Expanded gamepad CCMD

* Rename enum JoyResponseCurve to EJoyCurve

* Initial menu implementation

* Fixed SDL controller setting saving

* SDL gamepads can now actually be disabled

* Fixed initial controller connect of some versions of SDL

* Spelling error

* Enable gamepad by default

* Fixed segfault on some versions of SDL

* Only block keydown
This commit is contained in:
Marcus Minhorst 2025-07-05 16:41:40 -04:00 committed by GitHub
commit 2a5cce543b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 1613 additions and 215 deletions

View file

@ -147,7 +147,9 @@ const char *KeyNames[NUM_KEYS] =
"DPadUp","DPadDown","DPadLeft","DPadRight", // Gamepad buttons
"Pad_Start","Pad_Back","LThumb","RThumb",
"LShoulder","RShoulder","LTrigger","RTrigger",
"Pad_A", "Pad_B", "Pad_X", "Pad_Y"
"Pad_A", "Pad_B", "Pad_X", "Pad_Y",
"Paddle_1", "Paddle_2", "Paddle_3", "Paddle_4",
"Guide", "Pad_Misc", "Pad_Touchpad"
};
FKeyBindings Bindings;