mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-11-03 09:14:36 +00:00
SDL now represents gamepad buttons as positional elements with a separate label
This gives applications and binding systems a clearer view of what the hardware is so they can make intelligent decisions about how to present things to the user. Gamepad mappings continue to use abxy for the face buttons for simplicity and compatibility with earlier versions of SDL, however the "SDL_GAMECONTROLLER_USE_BUTTON_LABELS" hint no longer has any effect. Fixes https://github.com/libsdl-org/SDL/issues/6117
This commit is contained in:
@@ -390,6 +390,8 @@ The SDL_EVENT_GAMEPAD_ADDED event now provides the joystick instance ID in the w
|
||||
|
||||
The functions SDL_GetGamepads(), SDL_GetGamepadInstanceName(), SDL_GetGamepadInstancePath(), SDL_GetGamepadInstancePlayerIndex(), SDL_GetGamepadInstanceGUID(), SDL_GetGamepadInstanceVendor(), SDL_GetGamepadInstanceProduct(), SDL_GetGamepadInstanceProductVersion(), and SDL_GetGamepadInstanceType() have been added to directly query the list of available gamepads.
|
||||
|
||||
The gamepad face buttons have been renamed from A/B/X/Y to North/South/East/West to indicate that they are positional rather than hardware-specific. You can use SDL_GetGamepadButtonLabel() to get the labels for the face buttons, e.g. A/B/X/Y or Cross/Circle/Square/Triangle. The hint SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS is ignored, and mappings that use this hint are translated correctly into positional buttons. Applications will now need to provide a way for users to swap between South/East as their accept/cancel buttons, as this varies based on region and muscle memory. Using South as the accept button and East as the cancel button is a good default.
|
||||
|
||||
SDL_GameControllerGetSensorDataWithTimestamp() has been removed. If you want timestamps for the sensor data, you should use the sensor_timestamp member of SDL_EVENT_GAMEPAD_SENSOR_UPDATE events.
|
||||
|
||||
SDL_CONTROLLER_TYPE_VIRTUAL has been removed, so virtual controllers can emulate other gamepad types. If you need to know whether a controller is virtual, you can use SDL_IsJoystickVirtual().
|
||||
@@ -502,8 +504,8 @@ The following symbols have been renamed:
|
||||
* SDL_CONTROLLER_BINDTYPE_BUTTON => SDL_GAMEPAD_BINDTYPE_BUTTON
|
||||
* SDL_CONTROLLER_BINDTYPE_HAT => SDL_GAMEPAD_BINDTYPE_HAT
|
||||
* SDL_CONTROLLER_BINDTYPE_NONE => SDL_GAMEPAD_BINDTYPE_NONE
|
||||
* SDL_CONTROLLER_BUTTON_A => SDL_GAMEPAD_BUTTON_A
|
||||
* SDL_CONTROLLER_BUTTON_B => SDL_GAMEPAD_BUTTON_B
|
||||
* SDL_CONTROLLER_BUTTON_A => SDL_GAMEPAD_BUTTON_SOUTH
|
||||
* SDL_CONTROLLER_BUTTON_B => SDL_GAMEPAD_BUTTON_EAST
|
||||
* SDL_CONTROLLER_BUTTON_BACK => SDL_GAMEPAD_BUTTON_BACK
|
||||
* SDL_CONTROLLER_BUTTON_DPAD_DOWN => SDL_GAMEPAD_BUTTON_DPAD_DOWN
|
||||
* SDL_CONTROLLER_BUTTON_DPAD_LEFT => SDL_GAMEPAD_BUTTON_DPAD_LEFT
|
||||
@@ -523,8 +525,8 @@ The following symbols have been renamed:
|
||||
* SDL_CONTROLLER_BUTTON_RIGHTSTICK => SDL_GAMEPAD_BUTTON_RIGHT_STICK
|
||||
* SDL_CONTROLLER_BUTTON_START => SDL_GAMEPAD_BUTTON_START
|
||||
* SDL_CONTROLLER_BUTTON_TOUCHPAD => SDL_GAMEPAD_BUTTON_TOUCHPAD
|
||||
* SDL_CONTROLLER_BUTTON_X => SDL_GAMEPAD_BUTTON_X
|
||||
* SDL_CONTROLLER_BUTTON_Y => SDL_GAMEPAD_BUTTON_Y
|
||||
* SDL_CONTROLLER_BUTTON_X => SDL_GAMEPAD_BUTTON_WEST
|
||||
* SDL_CONTROLLER_BUTTON_Y => SDL_GAMEPAD_BUTTON_NORTH
|
||||
* SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_LEFT => SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_LEFT
|
||||
* SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_PAIR => SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_PAIR
|
||||
* SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT => SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT
|
||||
@@ -552,14 +554,15 @@ SDL_AddHintCallback() now returns a standard int result instead of void, returni
|
||||
Calling SDL_GetHint() with the name of the hint being changed from within a hint callback will now return the new value rather than the old value. The old value is still passed as a parameter to the hint callback.
|
||||
|
||||
The following hints have been removed:
|
||||
* SDL_HINT_VIDEO_HIGHDPI_DISABLED - high DPI support is always enabled
|
||||
* SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS - gamepad buttons are always positional
|
||||
* SDL_HINT_IDLE_TIMER_DISABLED - use SDL_DisableScreenSaver instead
|
||||
* SDL_HINT_IME_SUPPORT_EXTENDED_TEXT - the normal text editing event has extended text
|
||||
* SDL_HINT_MOUSE_RELATIVE_SCALING - mouse coordinates are no longer automatically scaled by the SDL renderer
|
||||
* SDL_HINT_RENDER_LOGICAL_SIZE_MODE - the logical size mode is explicitly set with SDL_SetRenderLogicalPresentation()
|
||||
* SDL_HINT_VIDEO_HIGHDPI_DISABLED - high DPI support is always enabled
|
||||
* SDL_HINT_VIDEO_X11_FORCE_EGL - use SDL_HINT_VIDEO_FORCE_EGL instead
|
||||
* SDL_HINT_VIDEO_X11_XINERAMA - Xinerama no longer supported by the X11 backend
|
||||
* SDL_HINT_VIDEO_X11_XVIDMODE - Xvidmode no longer supported by the X11 backend
|
||||
* SDL_HINT_IME_SUPPORT_EXTENDED_TEXT - the normal text editing event has extended text
|
||||
|
||||
* Renamed hints SDL_HINT_VIDEODRIVER and SDL_HINT_AUDIODRIVER to SDL_HINT_VIDEO_DRIVER and SDL_HINT_AUDIO_DRIVER
|
||||
* Renamed environment variables SDL_VIDEODRIVER and SDL_AUDIODRIVER to SDL_VIDEO_DRIVER and SDL_AUDIO_DRIVER
|
||||
|
||||
Reference in New Issue
Block a user