Sam Lantinga
e7ee375f22
Fixed third-party Nintendo Switch Pro controllers shutting down when we try to set the home LED.
...
This fixes the PDP Afterglow Wireless Deluxe Controller.
(cherry picked from commit 0c16f4faf0 )
2023-06-14 15:15:27 -07:00
Sam Lantinga
4aec54988c
Allow switching licensed Nintendo Switch Pro controllers into gyro input mode
...
(cherry picked from commit 8c95bd814b )
2023-06-14 15:13:11 -07:00
Sam Lantinga
271e03f0d7
Added support for the PowerA Fusion Pro Wireless Controller in Bluetooth mode
...
This controller shows up with a VID/PID of 0, but has full functionality over Bluetooth
(cherry picked from commit cdfc0c5a33 )
2023-06-14 15:12:56 -07:00
Sam Lantinga
d4f9be4416
Updated to version 2.27.1 for release candidate
2023-06-13 19:44:26 -07:00
Sam Lantinga
1f5b21ead5
Removed more Linux Xbox mappings in favor of the automatic mapping
...
This fixes the Xbox Series X share button on Linux 5.x kernels.
(cherry picked from commit 0f4b15e16b )
2023-06-13 17:06:24 -07:00
Sam Lantinga
35c7884929
Use the automatic mapping instead of a hardcoded one for Xbox controllers on Linux
...
This is much more robust and able to dynamically create a mapping for Xbox One S, Xbox Series X, and Xbox Elite 2 controllers.
(cherry picked from commit 9567989eb3 )
2023-06-13 17:06:21 -07:00
Sam Lantinga
3f6c4ec6d0
Cleanup for previous change, fixing typos, etc.
...
(cherry picked from commit 883b0f4071 )
2023-06-13 17:04:54 -07:00
Sam Lantinga
fc72f12e7f
Added automatic mapping support for Xbox controllers on the 6.x Linux kernels
...
This automatically adds support for the share button and paddles when present.
(cherry picked from commit db1d4d3d76 )
2023-06-13 17:04:17 -07:00
Sam Lantinga
d2372c8538
Added automatic mapping for Xbox Elite paddles using the xpadneo driver
...
We can't actually tell yet whether a controller has paddles, so this code isn't effective, but I'll file an upstream issue and see if we can get that resolved.
(cherry picked from commit b0677f476f )
2023-06-13 10:12:07 -07:00
Sam Lantinga
7db23f4ef1
Fixed joystick vendor detection in Linux automatic gamepad mapping
...
(cherry picked from commit 071d1e29dd )
2023-06-13 10:11:55 -07:00
Sam Lantinga
b3e1fd97b8
Fixed enumerating Steam Controllers on iOS
...
(cherry picked from commit dec0dbff13 )
2023-06-13 05:44:34 -07:00
Sam Lantinga
c77aaa5d99
Fixed n3ds build
...
(cherry picked from commit d95dbe78bb )
2023-06-12 15:41:09 -07:00
Sam Lantinga
e4e0a12901
Reduce the chance of destroying the joystick mutex while it's in use
...
Fixes https://github.com/libsdl-org/SDL/issues/7811
(cherry picked from commit 6390165fd4c193631d6780758a4aeec0d02b90eb)
2023-06-12 15:31:16 -07:00
Sam Lantinga
2aa8525ecb
Fixed build
2023-06-10 09:29:09 -07:00
Sam Lantinga
36033e3832
Make it clear that you can't mix 2D rendering and the window surface API
...
Also added functions to query and destroy the window surface so you can switch between modes if you want.
See https://github.com/pygame-community/pygame-ce/issues/2190 for more details.
2023-06-10 08:54:36 -07:00
Sam Lantinga
320f3fffbe
Fixed querying device info on the MOBAPAD M073
...
The query packet needs to contain valid rumble data in order to be accepted by the controller.
Fixes https://github.com/libsdl-org/SDL/issues/7788
(cherry picked from commit 5490873daa )
2023-06-09 18:43:14 -07:00
Sam Lantinga
30b4d90f1c
Only update the serial number if it hasn't already been set
...
This fixes the serial number for Nintendo Switch Pro, which is queried from the hardware in device initialization, and was later clobbered by the USB string which isn't correct.
(cherry picked from commit 2042e9c4e3 )
2023-06-09 17:36:06 -07:00
Sam Lantinga
1cdd6dc829
Fixed reading input from the Razer Atrox Arcade Stick using Windows Gaming Input
...
(cherry picked from commit 172cfca51332a845abf9c141ae56aa121fe4ada5)
2023-06-09 14:36:12 -07:00
Sam Lantinga
4700fbcbdf
Don't bother re-encoding Latin1 characters in the ASCII range
...
(cherry picked from commit 6150b5b3cb )
2023-06-04 05:40:07 -07:00
Sam Lantinga
7c86d96e86
Fixed SDL_iconv_string() truncation when handling SDL_ICONV_E2BIG
...
(cherry picked from commit c369b90019 )
2023-06-04 05:14:44 -07:00
Sam Lantinga
bfef7c302c
Only convert the result of XLookupString() if it's not already UTF-8
...
Fixes https://github.com/libsdl-org/SDL/issues/7766
(cherry picked from commit 491ae20d96 )
2023-06-04 02:54:21 -07:00
Sam Lantinga
b9d1c483b9
Fixed building with the 16.1.4479499 Android toolchain
2023-06-03 23:55:56 -07:00
Sam Lantinga
dc94cca8dd
Fixed typo in cherry-pick (thanks @HadesD!)
2023-06-03 11:57:08 -07:00
Sam Lantinga
97fe777ab4
Steam uses a different VID/PID for the Steam Virtual Gamepad on Windows
...
(cherry picked from commit 6815e75caf )
2023-06-03 11:40:58 -07:00
Sam Lantinga
f1bad83a21
Revert "Fixed detection of the Steam Virtual Gamepad on macOS"
...
This reverts commit 7aa28ce279 .
Steam has been updated to send a version of 1 to avoid conflicts with controllers that report a version of 0.
2023-06-03 11:36:38 -07:00
Sam Lantinga
7aa28ce279
Fixed detection of the Steam Virtual Gamepad on macOS
...
(cherry picked from commit 5fcd70578b )
2023-06-02 18:39:22 -07:00
Sam Lantinga
c89a460672
Fixed build if SDL_JOYSTICK_RAWINPUT_MATCHING isn't enabled
...
(cherry picked from commit 7c55845c80 )
2023-06-02 11:20:55 -07:00
Sam Lantinga
e3bfacde3e
Don't use raw input while Remote Desktop is active
...
Raw input will not send game controller events while Remote Desktop is active, so dynamically switch between XInput and raw input when Remote Desktop state changes.
Fixes https://github.com/libsdl-org/SDL/issues/7759
(cherry picked from commit 767507fcf6 )
2023-06-02 11:19:44 -07:00
Sam Lantinga
9c05098ed9
Fixed WGI immediately being correlated with raw input devices with no input
...
The at rest match state is 0x0000008800000000, not 0
(cherry picked from commit e8b5b4881c )
2023-06-02 09:39:57 -07:00
Sam Lantinga
5007b96363
Fixed build warning
2023-05-28 19:23:56 -07:00
Sam Lantinga
b2e88ecfeb
Disable SDL_JOYSTICK_RAWINPUT_XINPUT
...
Apparently when using the Xbox One Wireless Adapter, using XInput at the same time as raw input will cause the controller to turn off immediately after connecting. This appears to be a bug in the Windows 11 driver stack, but since WGI provides all the extended functionality we need, this can be turned off for now.
Fixes https://github.com/libsdl-org/SDL/issues/3468
2023-05-28 18:41:21 -07:00
Sam Lantinga
7308325559
Added support for printing wide strings using "%ls" syntax
...
(cherry picked from commit 128ca70160 )
2023-05-26 14:59:30 -07:00
Sam Lantinga and Ozkan Sezer
63b8af3558
Disable unused local typedefs warning
...
This triggers on gcc 4.8.4 for compile time asserts inside of functions
Fixes https://github.com/libsdl-org/SDL/issues/7732
Co-authored-by: Ozkan Sezer <sezeroz@gmail.com >
2023-05-24 04:45:40 +03:00
Sam Lantinga
3f1fd5abff
Updated source to match SDL function prototype style
2023-05-23 10:59:03 -07:00
Sam Lantinga
92f72682e7
Document the Android SDK versions checked in Java code
...
(cherry picked from commit b48b1ce500 )
2023-05-23 08:45:43 -07:00
Sam Lantinga
78a92b4f9d
Fixed duplicate Joy-Con controllers on macOS
...
If both Apple and HIDAPI drivers see the controller, HIDAPI will be preferred.
Fixes https://github.com/libsdl-org/SDL/issues/7479
(cherry picked from commit 61ef4efdfa )
2023-05-22 14:52:05 -07:00
Sam Lantinga
7b2b99a996
Fixed handling the Saitek P3600, which doesn't use the Xbox 360 controller protocol
...
(cherry picked from commit cf0abf9911 )
2023-05-22 12:42:05 -07:00
Sam Lantinga
b6d051e226
Fixed reporting backspace key if there is no text in the edit buffer (thanks @312937!)
...
This workaround isn't necessary at API 30 and above.
Fixes https://github.com/libsdl-org/SDL/issues/7039
(cherry picked from commit c971795954 )
2023-05-22 12:01:52 -07:00
Sam Lantinga
0ad0347acb
Use numeric codes for Android versions, to avoid SDK dependencies
...
(cherry picked from commit 3f6b2d1a61 )
2023-05-22 12:01:52 -07:00
Sam Lantinga
a2f4783e75
Don't map the top keyboard row to numbers when using the one-handed DVORAK layouts (thanks @tormol!)
...
Fixes https://github.com/libsdl-org/SDL/pull/5127
2023-05-22 11:30:42 -07:00
Sam Lantinga
69644346ac
Added the hint SDL_HINT_ENABLE_SCREEN_KEYBOARD to control whether the on-screen keyboard should be shown when text input is active
...
Fixes https://github.com/libsdl-org/SDL/issues/7160
2023-05-20 11:09:36 -07:00
Sam Lantinga
00b87f1ded
Make sure the sentinel is at the end of the current event pump cycle
...
If we're waiting, it's possible to not get any events, then add the sentinel, then pump again and then add another sentinel. We want to make sure we only have one sentinel and that it's at the end of the currently pumped events.
Testing:
* Verified test case in https://github.com/libsdl-org/SDL/issues/6539
* Verified test case in https://github.com/libsdl-org/SDL/issues/5350
Fixes https://github.com/libsdl-org/SDL/issues/6539
2023-05-20 10:27:48 -07:00
Sam Lantinga
beca41480d
Undo name change for the controller list
...
(cherry picked from commit f60622c510 )
2023-05-19 14:27:06 -07:00
Sam Lantinga
43b12fd9bc
Moved the controller list out so it can be included elsewhere
...
(cherry picked from commit 24007b00b2 )
2023-05-19 14:23:57 -07:00
Sam Lantinga
e8ec8ba1d4
Added support for the Astro C40 in Xbox 360 mode
...
(cherry picked from commit a4b4dff4a2 )
2023-05-19 14:23:57 -07:00
Sam Lantinga
d42c303b24
Check to make sure the Windows joystick device has buttons and axes
...
This fixes incorrectly detecting the ROG CHAKRAM X mouse as a game controller on Windows 10
(cherry picked from commit 642504bc59 )
2023-05-15 21:44:20 -07:00
Sam Lantinga
237348c772
Changed all variadic macros into fixed (thanks @Wohlstand!)
2023-05-10 06:29:35 -07:00
Sam Lantinga
de93728674
Removed redundant __powerpc__ check
...
(cherry picked from commit b6df25c334 )
2023-05-06 08:44:48 -07:00
Sam Lantinga
707e9397ca
Removed memset_pattern4() from SDL headers
...
This requires including string.h, which isn't always done, so this commit simplifies dependencies on macOS
Fixes https://github.com/libsdl-org/SDL/issues/3657
2023-04-30 21:38:29 -07:00
Sam Lantinga
f72213c4ac
By default, OpenBSD uses Linux controller mappings
...
Fixes https://github.com/libsdl-org/SDL/issues/7609
(cherry picked from commit 255c3b7c82 )
2023-04-29 17:10:46 -07:00
Sam Lantinga
120bc77e91
Report PS3 accelerometer values in m/s2 instead of Gs
...
(cherry picked from commit 0467301baf )
2023-04-19 13:12:38 -07:00
Sam Lantinga
7ec9a4385a
More defensive coding against dangling device pointers
...
(cherry picked from commit acadb6f873 )
2023-04-06 13:21:44 -07:00
Sam Lantinga
6d7269815b
Clarified the expected sensor value when a game controller is at rest
...
(cherry picked from commit 1a20ccb289 )
2023-04-06 09:55:43 -07:00
Sam Lantinga
cb0cf14155
The latest Armor-X Pro firmware update fixes the sign on the Z axis of the sensors
...
(cherry picked from commit 558bbbb07a )
2023-04-06 09:55:39 -07:00
Sam Lantinga
51dcc3bb0b
The macOS minimum deployment target is now 10.11
...
Xcode 14.3 does not allow targeting 10.9, the minimum recommended version is 10.13 and the minimum possible version is 10.11.
(cherry picked from commit 73b2faea4e )
2023-04-05 11:40:50 -07:00
Sam Lantinga
f6363fde9a
Fixed crash if joystick->hwdata != NULL && device->driver == NULL
...
This should never happen, but we're seeing it in the wild, so make sure that we can never call into a NULL device driver.
(cherry picked from commit e13b74ccf0 )
2023-04-05 11:24:55 -07:00
Sam Lantinga
57043825ba
Fixed crash if dbus can't be initialized
...
(cherry picked from commit cf2c6fa58d )
2023-04-04 12:35:30 -07:00
Sam Lantinga
22685556e5
Don't probe for PlayStation controllers when we already know the controller type
...
Fixes https://github.com/libsdl-org/SDL/issues/7556
(cherry picked from commit 655a07bdd8 )
2023-04-04 12:35:20 -07:00
Sam Lantinga
f444eac557
Fixed analog triggers on the DualSense controller
...
(cherry picked from commit a67d410501 )
2023-04-04 12:35:20 -07:00
Sam Lantinga
c2ee45f5ff
The Xinmotek Controller is used in multiple products with different mappings
...
The mapping included here is for the Ultimate Atari Fight Stick
(cherry picked from commit f1099f8e70 )
2023-03-28 15:16:07 -07:00
Sam Lantinga
0bf63175ab
Fixed gyro values for the Armor-X Pro controller
...
(cherry picked from commit 8df7b4d853 )
2023-03-28 14:44:59 -07:00
Sam Lantinga
d043c8535b
Fixed the accelerometer and gyro axes for the Armor-X Pro controller
...
(cherry picked from commit 37517557ae )
2023-03-28 12:29:33 -07:00
Sam Lantinga
8bfbda1eab
Fixed the accelerometer sensitivity for the Armor-X Pro controller
...
(cherry picked from commit 8029a767ee )
2023-03-27 14:33:59 -07:00
Sam Lantinga
93c289b475
Increased precision for PS4 sensor data conversion
...
(cherry picked from commit 3340864786 )
2023-03-27 14:33:56 -07:00
Sam Lantinga
b57a6a1adf
Added gamepad mapping for Flydigi Vader 2 with the latest firmware (6.0.4.9)
...
(cherry picked from commit ed0937598e )
2023-03-18 11:36:50 -07:00
Sam Lantinga
57ae9f466d
Ignore the PS4 packet CRC if it's not being set correctly
...
This fixes handling the 8BitDo SN30 Pro with the 2.00 firmware in PS4 mode
Fixes https://github.com/libsdl-org/SDL/issues/7270
(cherry picked from commit 3951cae4a5 )
2023-03-13 20:00:19 -07:00
Sam Lantinga
ab1670386f
Added support for the trigger buttons on the Victrix Pro FS for PS5
...
(cherry picked from commit 8d7e61ea42364c256b76e7f6f2b6d6f90742bcb7)
2023-03-10 15:46:22 -08:00
Sam Lantinga
76e9d64b36
Removed space between sizeof and parentheses
2023-03-10 08:13:51 -08:00
Sam Lantinga
e9f9cb29fc
Fixed build warning on Android
...
(cherry picked from commit 2af6f4a3e4 )
2023-03-10 08:12:28 -08:00
Sam Lantinga
71dc7169d9
Added header for SDL_Delay()
2023-03-09 17:18:40 -08:00
Sam Lantinga
1e6ffc6294
Removed a duplicate delay accidentally added during code refactor
...
(cherry picked from commit 926db1bd54 )
2023-03-09 16:13:19 -08:00
Sam Lantinga
3f00fa16c6
Wait for the GCController framework to see IOKit devices
...
It occasionally takes a few millseconds for the GCController framework to handle the device notification and set up the device
Fixes the duplicate controller issue in https://github.com/libsdl-org/SDL/issues/6686
(cherry picked from commit 645823fc90 )
2023-03-09 16:13:19 -08:00
Sam Lantinga
0d76380042
Code style: changed "sizeof foo" to "sizeof(foo)" (thanks @sezero!)
...
(cherry picked from commit c6443d86c9 )
2023-03-09 15:23:59 -08:00
Sam Lantinga
46d143376a
If the client rect is empty, use the last known window size
...
This happens on Windows 11 with fullscreen desktop windows when the desktop is brought up with the Windows+D shortcut.
Fixes https://github.com/libsdl-org/SDL/issues/7419
(cherry picked from commit 2ca727aec6 )
2023-03-09 10:39:43 -08:00
Sam Lantinga
d9c07d9ef7
Fixed the documentation for SDL_SetRelativeMouseMode()
...
(cherry picked from commit fb0c3197e0 )
2023-03-08 22:33:23 -08:00
Sam Lantinga
35c13196f0
Fixed uninitialized variable
2023-03-08 08:40:38 -08:00
Sam Lantinga
f5c0760c6b
Disassociate the SDLOpenGLContext from the view before deleting it
...
If we don't do this, the view will be blanked even if another context is current and rendering from that context won't be visible.
Fixes https://github.com/libsdl-org/SDL/issues/4986
2023-03-08 01:15:21 -08:00
Sam Lantinga
63e6c19b7d
Use SDL_GL_DeleteContext instead of Cocoa_GL_DeleteContext for context cleanup
...
That will make the current context NULL before deleting the context.
2023-03-08 01:13:00 -08:00
Sam Lantinga
1bd9ebf533
If we're not the current fullscreen window and we don't want to be fullscreen, don't touch the current video mode
...
Fixes an assertion in qemu on macOS, which creates multiple hidden windows:
2023-03-07 09:56:55.304 qemu-system-i386[9931:2984587] *** Terminating app due to uncaught exception 'NSGenericException', reason: 'NSWindowStyleMaskFullScreen cleared on a window outside of a full screen transition. Called from (
0 AppKit 0x00000001968f77ac __25-[NSWindow setStyleMask:]_block_invoke + 140
1 AppKit 0x00000001968f76cc NSPerformVisuallyAtomicChange + 108
2 AppKit 0x00000001968f7580 -[NSWindow setStyleMask:] + 188
3 libSDL2-2.0.0.dylib 0x0000000106531328 Cocoa_SetWindowFullscreen + 568
4 libSDL2-2.0.0.dylib 0x0000000106501700 SDL_UpdateFullscreenMode + 1316
5 libSDL2-2.0.0.dylib 0x0000000106504270 SDL_SetWindowFullscreen_REAL + 328
6 libSDL2-2.0.0.dylib 0x000000010650117c SDL_FinishWindowCreation + 100
7 libSDL2-2.0.0.dylib 0x0000000106500998 SDL_CreateWindow_REAL + 1812
8 libSDL2-2.0.0.dylib 0x00000001063efd54 SDL_CreateWindow + 76
9 qemu-system-i386 0x00000001050aa600 sdl2_window_create + 192
10 qemu-system-i386 0x00000001050a9fa0 sdl2_2d_switch + 196
11 qemu-system-i386 0x0000000104e9c784 displaychangelistener_display_console + 524
12 qemu-system-i386 0x0000000104e9e36c register_displaychangelistener + 264
13 qemu-system-i386 0x00000001050ab6d0 sdl2_display_init + 304
14 qemu-system-i386 0x000000010505c870 qemu_init + 13380
2023-03-07 10:10:43 -08:00
Sam Lantinga
e0e79419b6
Fixed which window we check flags for when updating fullscreen mode
2023-03-07 10:08:55 -08:00
Sam Lantinga
8fc10ac95c
Added mapping for the Xbox Elite Core controller connected via Bluetooth on Android
...
(cherry picked from commit d08338ddc5 )
2023-03-06 15:37:52 -08:00
Sam Lantinga
f47a08ab84
Fixed typo in previous cherry-pick
2023-03-01 16:47:48 -08:00
Sam Lantinga
660fc89967
Don't clobber an existing entry with a different version when adding a gamepad mapping
...
(cherry picked from commit 727c7d4e2f )
2023-03-01 16:41:44 -08:00
Sam Lantinga
6ff3e49b6f
Follow the same pattern for releasing the window data in the UIKit driver
...
Possible fix for https://github.com/libsdl-org/SDL/issues/7361
(cherry picked from commit ebdb320651 )
2023-02-28 16:15:01 -08:00
Sam Lantinga
031348d377
Fixed SDL windows getting the maximized state after leaving fullscreen on macOS
...
(cherry picked from commit 2df08fb1b27b721998a1380a2acdbe1494b5591e)
2023-02-28 09:03:10 -08:00
Sam Lantinga
c0fb092425
Fixed locking up the Logitech F310 with the PlayStation controller detection
...
(cherry picked from commit da134a3039 )
2023-02-28 08:37:18 -08:00
Sam Lantinga
715749f578
Added mapping for DualSense Edge Wireless Controller on Linux
...
This is a mapping when using evdev, not the more advanced HIDAPI support.
(cherry picked from commit 206fa4dafb )
2023-02-27 15:21:04 -08:00
Sam Lantinga
ad09976eca
Fixed relative mouse motion over remote desktop
...
Setting the cursor clip area to a single pixel prevents the relative mouse motion remote desktop warping from working, so the mouse is never recentered.
(cherry picked from commit daffe02b11 )
2023-02-24 09:23:23 -08:00
Sam Lantinga
3bf9c70a7c
Changed the VID/PID used for the Backbone One controller on iOS
...
(cherry picked from commit 516e48515e )
2023-02-23 12:24:49 -08:00
Sam Lantinga
ea7103088f
Added support for the Backbone One PlayStation Edition
...
(cherry picked from commit 59bf1c2853 )
2023-02-23 11:59:10 -08:00
Sam Lantinga
a3a45f6709
Fixed view frame from flipping back and forth between landscape and portrait on iOS
...
(cherry picked from commit b2d913883c )
2023-02-23 11:59:00 -08:00
Sam Lantinga
13969f8567
De-duplicate Google Stadia controllers on macOS
...
(cherry picked from commit 87a83787a3 )
2023-02-21 15:35:25 -08:00
Sam Lantinga
9be85b846b
Rumbling the Google Stadia Controller over Bluetooth works on Linux and macOS
...
(cherry picked from commit 4aeec9d8c2 )
2023-02-21 15:07:24 -08:00
Sam Lantinga
35c9b1042f
Fixed the packet size for Xbox One controllers
...
(cherry picked from commit 021a7cfa13 )
2023-02-21 12:48:10 -08:00
Sam Lantinga
31a57c05dc
Fixed the share button on the ThrustMaster eSwap PRO Controller Xbox
...
(cherry picked from commit e4face7c1d )
2023-02-21 12:43:20 -08:00
Sam Lantinga
3dff5d3cbe
Added support for the Turtle Beach REACT-R and Recon Xbox controllers
...
(cherry picked from commit 5fded632d6 )
2023-02-21 11:29:45 -08:00
Sam Lantinga
4c9a79dddb
Removed duplicated conditional
...
(cherry picked from commit 1a15d506a6 )
2023-02-20 18:26:07 -08:00
Sam Lantinga
7c4f5e1def
Fixed rumble caps for the Nintendo Joy-Con controllers
...
(cherry picked from commit 02cea5fca1 )
2023-02-20 18:25:57 -08:00
Sam Lantinga
abe8dbbf1c
Added support for the Razer Wolverine V2 controllers
...
(cherry picked from commit 4994654d4f )
2023-02-20 18:25:38 -08:00
Sam Lantinga
0efb31ef32
cocoa/gles: do not unload EGL when context is destroyed
...
(cherry picked from commit e8091b8983 )
2023-02-20 10:43:15 -08:00