Sam Lantinga
58882425fc
Use the lower index axis if the controller generates two axes for a single element
...
The Flydigi Apex and Vader controllers fire both axis 4 and 5 for the right thumbstick Y axis, for example.
2023-07-19 09:48:32 -07:00
Sam Lantinga
255f297439
Fixed crash if SetMappingValue() is passed a NULL key
2023-07-19 09:23:08 -07:00
Sam Lantinga
58e3084477
The Flydigi Vader and Apex series controllers all have the same VID, PID, and name
2023-07-19 09:22:01 -07:00
Sam Lantinga
e413457a7e
Fixed clearing the mapping in testcontroller
2023-07-18 22:10:44 -07:00
Sam Lantinga
732218c222
Changed binding order to match Steam
2023-07-18 22:04:55 -07:00
Sam Lantinga
53882a2ed2
Map the buttons in ABXY order
2023-07-18 17:36:40 -07:00
Sam Lantinga
85eb1fa515
Fixed double-comma if the crc is first in the mapping
2023-07-18 17:32:46 -07:00
Sam Lantinga
c0e0f47755
Make sure there are commas in gamepad mapping strings
2023-07-18 17:11:02 -07:00
Anonymous Maarten
b1a0bc3fb0
testlocale: only ininitialize video when needed
2023-07-19 00:14:38 +02:00
Ozkan Sezer
4ca0e937e1
hidapi: remove unwanted files (e.g.: .git*, etc...)
2023-07-19 00:55:04 +03:00
Ozkan Sezer
40ac818bf8
hidapi: sync with mainstream (typo fixes)
2023-07-19 00:40:10 +03:00
Sam Lantinga
2bf05f38ad
Increased the timeout when opening /dev/hidraw nodes
...
We're still seeing it taking longer than 10ms for permissions to become available on Steam Deck.
2023-07-18 14:28:55 -07:00
Anonymous Maarten
e620925728
testlocale: don't pass SDL_INIT_VIDEO to SDL_Init
2023-07-18 22:48:14 +02:00
Frank Praznik
ef4ce8cec5
test: Add flag to suspend drawing when occluded
...
Add the flag "--suspend-when-occluded" to testgl, testgles2, and testsprite, which, when used, will suspend rendering and throttle the event loop when the occlusion flag is set on the window.
2023-07-18 16:42:05 -04:00
Frank Praznik
44536b7537
Add and event and flag to report when a window has been occluded
...
Adds the SDL_EVENT_WINDOW_OCCLUDED events and the window flag SDL_WINDOW_OCCLUDED to report when the window occlusion state has changed, so that the application can take appropriate measures, as it may wish to suspend drawing, throttle, or otherwise behave in a more energy efficient manner when the window is not visible. When the window is no longer occluded, the SDL_EVENT_WINDOW_EXPOSED event is sent and the occlusion flag is cleared.
This is handled on macOS via the window occlusion state event (available as of 10.9), and via the xdg-shell protocol on Wayland (version 6, wayland-protocols 1.32, passed through in libdecor 0.1.2).
2023-07-18 16:42:05 -04:00
Sam Lantinga
7aec9ad4a6
Make sure the mapping string doesn't have extraneous whitespace
...
If that whitespace is extra newlines in the mapping hint, we would create extra empty mapping strings
2023-07-18 13:25:47 -07:00
Sam Lantinga
9db2cb3513
Added SDL_ReloadGamepadMappings() to reset the SDL gamepad mappings
2023-07-18 12:50:10 -07:00
Sam Lantinga
75e7a6fcfa
SDL_AddGamepadMappingsFromFile() has been made into a real function
2023-07-18 12:05:04 -07:00
Sam Lantinga
dfc6e8825e
Improved reliability of gamepad message ordering
...
The gamepad vs joystick events always happen in this order:
SDL_EVENT_JOYSTICK_ADDED
SDL_EVENT_GAMEPAD_ADDED
SDL_EVENT_GAMEPAD_REMAPPED
SDL_EVENT_GAMEPAD_REMOVED
SDL_EVENT_JOYSTICK_REMOVED
Whenever a mapping is changed, any controller affected by that mapping will generate a gamepad event. You will only get one SDL_EVENT_GAMEPAD_REMAPPED event per controller per batch of mapping changes, where SDL_AddGamepadMappingsFromFile() and SDL_AddGamepadMapping() are each a batch of changes.
2023-07-18 11:52:56 -07:00
Sam Lantinga
ccefce8321
Send gamepad and joystick removed events when quitting
...
This helps applications do proper cleanup when reinitializing gamepads, e.g. to reset controller mappings
2023-07-18 09:01:14 -07:00
Sam Lantinga
0a4e6f6d29
Added SDL_strnlen() and SDL_wcsnlen()
2023-07-17 19:37:51 -07:00
rfht
4d63c919f9
simplify OpenBSD D-pad calculation with bitwise operation ( #7996 )
2023-07-17 19:01:23 -07:00
Sam Lantinga
4a18893c73
Don't fail to create a window if it's too large, just clamp it to the max instead
...
Some window is better than no window...
2023-07-17 17:48:11 -07:00
Sam Lantinga
eb8b5ed3a4
Fixed crash when the joystick can't be opened
2023-07-17 17:35:38 -07:00
Sam Lantinga
2ebbfe7c5b
Added an "auto" mode for PS4 and PS5 controller rumble hints
...
This allows the controllers to report that they have sensors and enhanced capabilities, but not actually switch into enhanced mode (breaking DirectInput) unless the application tries to use them.
2023-07-17 17:32:57 -07:00
Sam Lantinga
bd4f155bbb
Fixed LED pending check failing when the controller timestamp is very large
...
In this case we know the controller has been on for a while and the Bluetooth connection LED cycle is complete.
Also fixed the timestamp being zero the first time it is checked
2023-07-17 17:08:17 -07:00
Sam Lantinga
16dd5f0da4
Don't send k_EPS5FeatureReportIdCapabilities to Sony PS5 controllers
...
This report is for third party controllers only.
2023-07-17 16:45:31 -07:00
Sam Lantinga
2fef0be2f6
Don't tickle Bluetooth PS5 controllers in simple mode with an effects packet
...
That will put the PS5 controller into enhanced mode, which breaks DirectInput games
2023-07-17 16:42:58 -07:00
Sam Lantinga
75d4a91aaa
Use SDL_GAMEPAD_TYPE_UNKNOWN, not SDL_GAMEPAD_TYPE_INVALID
2023-07-17 13:54:55 -07:00
SDL Wiki Bot
27556e098e
Sync SDL3 wiki -> header
2023-07-17 20:00:18 +00:00
Sam Lantinga
b271e92c6e
Added the ability to specify a gamepad type in the mapping
...
Also renamed most cases of SDL_GAMEPAD_TYPE_UNKNOWN to SDL_GAMEPAD_TYPE_STANDARD, and SDL_GetGamepadType() will return SDL_GAMEPAD_TYPE_UNKNOWN only if the gamepad is invalid.
2023-07-17 12:59:56 -07:00
Sam Lantinga
57820071a4
Added the ability to rename your controller
2023-07-16 15:57:32 -07:00
Sam Lantinga
08db0e8f64
Allow clicking on the gamepad image to bind elements
2023-07-16 15:57:32 -07:00
Sam Lantinga
8f21be87fc
Allow using A and B to navigate the controller binding flow
2023-07-16 15:57:32 -07:00
Sam Lantinga
f3fe579cf0
Sort the entries in the controller mapping
2023-07-16 15:57:32 -07:00
Sam Lantinga
787786bdbc
testcontroller: memory management cleanup
...
Also saved the guide button for last in the binding flow, since it may not be present on the controller or available from the OS
2023-07-16 15:57:32 -07:00
Ozkan Sezer
611b3dd1fd
remove unused vulkan/*.hpp files.
2023-07-17 00:10:50 +03:00
Anonymous Maarten
87ccb886fe
cmake: remove ability to build tests as a standalone project
2023-07-16 20:22:41 +02:00
Anonymous Maarten
80da0cf06d
cmake: convert bmp images to c headers using python script
...
A pure CMake script was too slow
2023-07-16 16:31:06 +02:00
SDL Wiki Bot
74612701bb
Sync SDL3 wiki -> header
2023-07-16 11:33:16 +00:00
Sam Lantinga
1a4995371b
Use light text for button labels so they show up well over the activity highlight
2023-07-16 04:32:12 -07:00
Sam Lantinga
ae0fce3f01
testcontroller: show face button labels over the activity highlight
2023-07-16 04:32:12 -07:00
Sam Lantinga
505a8dfb15
testcontroller replaces gamepadmap
2023-07-16 04:32:12 -07:00
Sam Lantinga
8296242f2e
We don't need to be verbose about gamepad events now that we can visualize them
2023-07-16 04:32:12 -07:00
Sam Lantinga
d90b938f0f
Additional work on binding mode for testcontroller
2023-07-16 04:32:12 -07:00
Sam Lantinga
5388edd549
Removed Flydigi Vader 2 mappings
...
Many of the Flydigi controllers use the same VID/PID and have different mappings, so let's revisit this once we have more data.
2023-07-16 04:32:12 -07:00
Sam Lantinga
57cfd1e106
Removed SDL_GAMEPAD_TYPE_VIRTUAL, SDL_GAMEPAD_TYPE_AMAZON_LUNA, SDL_GAMEPAD_TYPE_GOOGLE_STADIA, and SDL_GAMEPAD_TYPE_NVIDIA_SHIELD
...
Removing SDL_GAMEPAD_TYPE_VIRTUAL allows a virtual controller to emulate another gamepad type. The other controller types can be treated as generic controllers by applications without special glyph or functionality treatment.
2023-07-16 04:32:12 -07:00
Sam Lantinga
689555a400
Added gamepad BMP files used as sources for the header files
2023-07-16 04:32:12 -07:00
Sam Lantinga
404e030b39
Added binding mode to testcontroller
2023-07-16 04:32:12 -07:00
Sam Lantinga
6c2472d459
Relicensed testutils to match other test code
...
Permission granted in 76a7b629bf (commitcomment-121408342)
2023-07-16 04:32:12 -07:00