Commit graph

11739 commits

Author SHA1 Message Date
Tyson Whitehead 3b1e0e163b Try SDL_UDEV_deviceclass to detect joysticks even if in a container
The udev container issue is mostly to do with device notifications
and netlink. The device classification stuff just pokes file in /sys
and /run/udev. Doesn't hurt to try it first for classifying joysticks
and then fall to the guess heuristics if it fails.
2023-12-24 16:02:38 -08:00
Sam Lantinga 857e5b08c3 Fixed trying to add a game controller mapping for the accelerometer on iOS
Fixes https://github.com/libsdl-org/SDL/issues/8716

(cherry picked from commit 0e5ea3cc4b98d061688a098836254ab6470b07e8)
2023-12-24 11:22:22 -08:00
Sam Lantinga 49eb375a59 Added SDL2.framework to the embedded frameworks for SDL test programs
Fixes https://github.com/libsdl-org/SDL/issues/8737
2023-12-24 09:17:48 -08:00
Sam Lantinga aeda6a8e6f Record the initial input report mode and only restore simple mode if that's what we started with
Fixes https://github.com/libsdl-org/SDL/issues/8108
Closes https://github.com/libsdl-org/SDL/pull/8115

(cherry picked from commit c3d84c3342f61b808462c7437784af5df4906273)
2023-12-24 08:23:36 -08:00
Sam Lantinga fe76c40716 Added a runtime check for BLUETOOTH_CONNECT in addition to BLUETOOTH (thanks @perepujal!)
Fixes https://github.com/libsdl-org/SDL/issues/8731

(cherry picked from commit bb0e0ae0809c42e5a20f7e13aad8a34b8e7145cf)
2023-12-24 06:51:48 -08:00
Julian Uy 884c21c565 Use common generic syscond for platforms with no cond implementation 2023-12-24 06:35:59 -08:00
Julian Uy 557d8e2f24 PS2 use WaitSemaEx for waiting for semaphore with timeout 2023-12-24 06:34:45 -08:00
Sylvain 3a8032f491 Make sure the string is terminated, fixed invalid read in SDL_PrivateGameControllerParseControllerConfigString()
(cherry picked from commit 312f98c2a1edaf9590fc06d10f201996c059d869)
2023-12-23 12:58:54 -08:00
Lukas Senionis e7c4575719 Use crc16 return value when calculating GUID
Fixes the regression introduced by 919cd56b20

(cherry picked from commit a2e05480d63cac530269c846422e7de3b44e830f)
2023-12-21 07:00:57 -08:00
Ozkan Sezer 39a0013900 Makefile.os2: -DSDL_USE_LIBICONV to fix linkage for GNU libiconv option 2023-12-21 08:55:04 +03:00
Ozkan Sezer ca26cde4e1 SDL_config_os2.h: enable SDL_JOYSTICK_VIRTUAL 2023-12-21 08:55:02 +03:00
Sam Lantinga eba591a910 Fixed Xcode project 2023-12-20 19:42:43 -08:00
Sam Lantinga 919cd56b20 Use the original manufacturer and product strings for the joystick CRC
This allows the most information possible for the CRC string, which is used to differentiate controllers with the same VID/PID.

Fixes https://github.com/libsdl-org/SDL/issues/8724

(cherry picked from commit 1f1ee6f77c492e17a9691c367110c11529fab3fb)
2023-12-20 19:25:35 -08:00
Ozkan Sezer d76097dc5e fix os/2 and watcom builds after commit 7bb0e839a6 2023-12-21 01:11:24 +03:00
Sam Lantinga 2fecefce19 Updated Xcode project with Steam Deck controller driver 2023-12-20 13:29:58 -08:00
Sam Lantinga 7bb0e839a6 Added Steam Input API support for game controllers
Added support for getting the real controller info, as well as the function SDL_GameControllerGetSteamHandle() to get the Steam Input API handle, from the virtual gamepads provided by Steam.

Also added an event SDL_CONTROLLERSTEAMHANDLEUPDATED which is triggered when a controller's API handle changes, e.g. the controllers were reassigned slots in the Steam UI.

(cherry picked from commit c981a597dc7c69e7532796b3a206071807479d35)
2023-12-20 13:29:57 -08:00
Sylvain 9720672374 Fix compilation / same as sdl2-compat
testautomation_platform.c:351:28: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  351 |     result = SDL_SetError("%s", testError);
      |                            ^~
/home/slvn/release/Release_SDL/sdl2-compat/test/testautomation_platform.c:364:64: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  364 |                             "SDL_GetError(): expected message '%s', was message: '%s'",
(cherry picked from commit 56f111dffc2828d67fd8e0402b0fe1193c48ce26)
2023-12-20 22:29:51 +03:00
Vicki Pfau 5240071b1c Sync more Steam Controller header definitions for the Steam Deck
(cherry picked from commit a8f4f40d08a28ca0ef4f518509639f2553d8a123)
2023-12-20 06:50:54 -08:00
Ozkan Sezer 5773c347d5 test/watcom.mif: disable W201 warning for testautomation_stdlib.c. 2023-12-17 20:51:10 +03:00
Ozkan Sezer 3ac69c6210 test/watcom.mif: remove a stale rule. 2023-12-17 20:51:02 +03:00
Sam Lantinga 91f8b4dea2 Added a controller name for the Steam virtual gamepad
(cherry picked from commit 4d5949dcf64f2633b1b435fb0c22a3b0b44d855f)
2023-12-17 10:08:17 -08:00
Sam Lantinga 2aadef022e Pass through the name of the controller for the XInput mapping
(cherry picked from commit e6d88b254add377743de7bf33a7a4fec8cec79c3)
2023-12-17 09:32:54 -08:00
Dimitriy Ryazantcev 7391cd34da XInput: Use XInputGetCapabilitiesEx instead of fragile GuessXInputDevice
XInputGetCapabilitiesEx (ordinal 108) is available in XInput 1.4 that is shipped with Windows 8 and newer.

(cherry picked from commit 08a7ca4d53ef0d504ec780936fd65616fe3a9f09)
2023-12-17 09:32:43 -08:00
Sam Lantinga d622c3c9cc Verify that the %p format specifier works for 64-bit pointers
(cherry picked from commit 7f75178908355046e37d908648c44cf4d4625f09)
2023-12-17 08:15:19 -08:00
Susko3 cfecc569b5 Differentiate between Windows Ink (pen) and regular touch input
SDL2 backport of https://github.com/libsdl-org/SDL/pull/5926
2023-12-16 21:41:22 -08:00
Frank Praznik 867d8643d7 wayland: Handle mouse focus when receiving touch events
Compositors may switch from mouse to touch mode when a touch event is received, causing a pointer leave event and subsequent loss of mouse focus.

Don't relinquish mouse focus on surfaces with active touch events. If there are active touch events when pointer focus is lost, the keyboard focus is used as a fallback for relinquishing mouse focus: if, in this case, the keyboard focus is then lost and there are no active touches, mouse focus is lost, and if all touches are raised and there is no keyboard or pointer focus, then the window loses mouse focus.

(cherry picked from commit 21879faf4815a6acdb29e290d51a15bbe4dae03e)
2023-12-14 14:33:18 -05:00
Sam Lantinga 239b5278bf Revert "Back out Steam virtual gamepad changes"
This reverts commit f0e7f3e7e5.
2023-12-13 09:46:10 -08:00
Frank Praznik cc6d8eb72b tests: Fix whitespace 2023-12-12 17:17:00 -05:00
Frank Praznik a78cdbd7e3 tests: Backport automated video test changes
Changes to the SDL3 video system required some changes to the test suite since the video system always reports the true window size and position.

While SDL2 doesn't directly require these changes, they are needed for SDL2-Compat and committed here to keep the two test suites in sync.
2023-12-12 16:10:44 -05:00
Max Maisel 33588662ef Refactor away some additional integer types. 2023-12-12 12:52:04 -08:00
Max Maisel b620788b4c Add new file to OpenWatcom makefiles. 2023-12-12 12:52:04 -08:00
Max Maisel 20cc644833 Add new file to vcxproj files. 2023-12-12 12:52:04 -08:00
Max Maisel bed789794d Add new steam deck HIDAPI controller to controller database. 2023-12-12 12:52:04 -08:00
Max Maisel 0dbe9022fc Disable lizard mode while steam deck HID device is opened. 2023-12-12 12:52:04 -08:00
Max Maisel a6b9d987e9 Translate steam deck HID reports to SDL events. 2023-12-12 12:52:04 -08:00
Max Maisel 5718ba253f Implement steam deck HIDAPI initialization. 2023-12-12 12:52:04 -08:00
Max Maisel e7f03de468 Add steam deck detection and HIDAPI driver scaffold. 2023-12-12 12:52:04 -08:00
Dimitriy Ryazantcev 33843b0933 Use existing XUSB driver software PID 0x02a1 instead of PID 0x02fe
0x02fe is actually PID of Xbox Wireless Adapter for Windows 10 (Model 1790) and creates confusion.

Here is USB descriptor dump: https://github.com/DJm00n/ControllersInfo/blob/master/xboxone/DescriptorDump_Adapter%20(Xbox%20Wireless%20Adapter%20for%20Windows).txt

(cherry picked from commit c790572674b225de34fe53c0a0188dca8a05c722)
2023-12-11 11:49:28 -08:00
Sam Lantinga 7d94121606 You should call present when using a software renderer as well.
Fixes https://github.com/libsdl-org/SDL/issues/8676

(cherry picked from commit 581d1cab257a14cd235df2192f012abb0d4e36e0)
2023-12-11 08:44:11 -08:00
Sam Lantinga 79a8e8cf04 Make built-in joystick device lists extendable by using hints
Fixes https://github.com/libsdl-org/SDL/issues/8595

(cherry picked from commit 5173b0c2cce5a68f1f72d77b4788f5e1da332719)
2023-12-10 22:52:12 -08:00
Sam Lantinga 6526c4d0fc Refactor VIDPID list loading code
(cherry picked from commit d91e96e7f50b9c3cb0e1dacda39274b4af037a96)
2023-12-10 09:02:56 -08:00
Sam Lantinga f0e7f3e7e5 Back out Steam virtual gamepad changes
We are planning a different approach to handle these
2023-12-10 08:38:20 -08:00
Anonymous Maarten 10c292b055 cmake+xcode: use IMPORTED SHARED framework target 2023-12-10 11:50:11 +01:00
Sam Lantinga ddac844034 Fixed build 2023-12-09 21:44:12 -08:00
Sam Lantinga dd28637947 Use the Steam virtual gamepad slot as the gamepad player index
(cherry picked from commit 7529d25b2b99e2f790c418e479e7ce85c1c818e6)
2023-12-09 21:01:08 -08:00
Sam Lantinga 5b26d4e0ca Sort Steam virtual gamepads by Steam controller slot
This makes sure that games launched by Steam see the first controller first, and the controllers in the game match up with the controllers in the Steam UI.

Fixes https://github.com/libsdl-org/SDL/issues/8672

(cherry picked from commit 17723381da9bc3eadb129beaeaed2164c64b5155)
2023-12-09 20:35:33 -08:00
Ethan Lee 757c984ddb gamecontroller: Backport 3.0 'type:' field to 2.0 2023-11-30 14:42:56 -08:00
Ryan C. Gordon 61cd57d378 cocoa: Resync modifier keypressed on NSEventTypeFlagsChanged event.
Fixes #7507.

(cherry picked from commit 70b65d4170bbff6a8c2ffc9b5834ec85384f6fc0)
2023-11-29 21:40:30 -05:00
Anonymous Maarten 0134672345 cmake: copy sources to binary directory in separate target
Don't do it in POST_BUILD to avoid multiple parallel builds
stepping on each others toes.
Also don't use copy_if_different, but unconditionally copy it.
The build system should take care of dependencies.

SDL2 backport of fea6e7afb1c13326f463aef47ecd26396d1e3a2f
2023-11-28 23:03:30 +01:00
Sam Lantinga 8f14dc6998 Corrected comment
(cherry picked from commit 45938bbfa532e4c1cdef202a72d899a37a7baf05)
2023-11-28 12:30:10 -08:00