Commit Graph

12913 Commits (f3fe579cf094a4f0bd255b12699f2482cca3d464)

Author SHA1 Message Date
Sam Lantinga e425fdd416 Added the controller name and info to the testgamepad window
Also added instructions for using the Virtual Controller
2023-07-10 19:13:51 -07:00
Sam Lantinga 3cbf16b944 Added SDL_GetGamepadInstanceID() 2023-07-10 19:13:42 -07:00
Sam Lantinga 50277a0355 Show touchpad and sensor output on screen in testgamepad 2023-07-10 18:05:31 -07:00
Sam Lantinga d44ada59fb Added joystick and gamepad element display in testgamepad 2023-07-10 17:06:42 -07:00
Sam Lantinga 4a53dc5b8d Added touchpad visualization for testgamepad 2023-07-10 11:36:32 -07:00
Sam Lantinga 33d025d35a Fixed loading 8-bit BMP exported by Gimp with RGB masks 2023-07-10 11:36:31 -07:00
Ozkan Sezer 1e50823a14 fixed linux build. 2023-07-10 20:35:50 +03:00
Sam Lantinga 95d17f9d2c Minor cleanup
(cherry picked from commit 92fd2938e737cf044d2da781cf0f4b4b4de4463f)
2023-07-10 10:02:57 -07:00
Andre Barata 47fd07bde6 Added support for absolute mice with evdev
(cherry picked from commit 9cd7cbe13464d9f0f80ef205e84e62f6da849aa1)
2023-07-10 10:02:13 -07:00
Sam Lantinga 49b9fd1843 Don't send k_ePS4FeatureReportIdSerialNumber to Bluetooth PS4 controllers
This isn't supported over Bluetooth and might be causing issues with fake PS4 controllers.

Note that this change should NOT be ported to SDL2, as device->is_bluetooth is not set from hidapi there and is only detected by seeing which reports are valid.

Reference https://github.com/libsdl-org/SDL/issues/7960
2023-07-10 09:37:20 -07:00
Sam Lantinga 092a4b780c Don't send k_ePS4FeatureReportIdCapabilities to Sony PS4 controllers
This report is for third party controllers only, and might be causing issues with fake PS4 controllers.

Reference https://github.com/libsdl-org/SDL/issues/7960
2023-07-10 09:37:20 -07:00
Sam Lantinga 5ce967a579 Apply the display content scale to the gamepad test window 2023-07-10 09:37:20 -07:00
Simon McVittie 8b12585e1d testevdev: Add some examples of PDP third-party Switch controllers
Thanks: Ravi Kanodia
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-07-10 08:59:18 -07:00
Sam Lantinga efd530827a Return from main() instead of calling exit() 2023-07-09 20:42:00 -07:00
Sam Lantinga 8f5ec2f596 Added shared code between testgamepad and gamepadmap
The goal is to eventually create a single program that can do mapping and testing of game controllers.
2023-07-09 19:24:36 -07:00
SDL Wiki Bot 550c84b4df Sync SDL3 wiki -> header 2023-07-09 20:50:16 +00:00
Sam Lantinga bea99d48f2 Changed 'freesrc' parameter from int to SDL_bool 2023-07-09 13:49:04 -07:00
Sam Lantinga 32d529bf70 Use size_t for the size of memory RWops 2023-07-09 13:36:00 -07:00
Sam Lantinga 80e1c75e1c Re-added mappings for older Xbox One controllers on Linux
The xpad kernel driver doesn't know about these controllers and ends up using BTN_C and BTN_Z and the automatic mapping doesn't work correctly.

It turns out VID 0x045e and PID 0x02e0 is used by the 8BitDo SN30 Pro when connecting via Bluetooth in XInput mode.

Fixes https://github.com/libsdl-org/SDL/issues/7925
2023-07-09 09:50:26 -07:00
Joshua Barnett a5f387f828 Add kernel32 to SDL_EXTRA_LIBS required for cross-compilation to Win32 native
Linking error experienced while compiling with the following toolchain
due to lack of kernel32.lib

d35e5f8dde/cmake/platforms/WinMsvc.cmake (L317-L321)
2023-07-09 09:18:04 +02:00
Sam Lantinga ea60da5b94 Fixed mapping BTN_TR2 to right trigger 2023-07-08 18:18:22 -07:00
Alex Maese 0e4165e54b X11: Use XFixes to detect clipboard updates
Currently, SDL_CLIPBOARDUPDATE events are only sent when an SDL window
has its selection cleared.  This change sends the event anytime the
XFixesSelectionNotify event is raised, and when the selection is either
the clipboard or the primary selection.
2023-07-08 16:26:10 -07:00
Sam Lantinga cd97e3a833 Fixed clang Windows build 2023-07-08 14:10:08 -07:00
Sam Lantinga a29aac603b Quiet warning when using older buggy WGI headers 2023-07-08 13:28:22 -07:00
Sam Lantinga 7d894dc1c9 Fixed build warnings 2023-07-08 11:16:40 -07:00
Sam Lantinga f047e178b6 Added WGI gamepad added/removed listeners for RAWINPUT
This fixes WGI correlation on startup when the WGI gamepad list isn't populated yet
2023-07-08 10:24:00 -07:00
Sam Lantinga cdfc9634e1 Removed patch note for change already in SDL 2.x 2023-07-08 09:35:42 -07:00
Sam Lantinga 3a654b4b1c Added the hint SDL_HINT_JOYSTICK_WGI to control whether to use Windows.Gaming.Input for controllers 2023-07-08 09:32:24 -07:00
Mathieu Eyraud a4f3905bb6 Fix uninitialised variable 2023-07-08 08:36:36 -07:00
Sam Lantinga efed24850a Don't tickle Bluetooth PS4 controllers in simple mode with an effects packet
That will put the PS4 controller into enhanced mode, which breaks DirectInput games
2023-07-07 15:56:54 -07:00
Sam Lantinga 785f57eb91 Lazily initialize the WGI gamepad support
Initializing "Windows.Gaming.Input.Gamepad" will put Bluetooth PS4 controllers into enhanced report mode, which breaks any game using DirectInput. Let's wait to do this until absolutely necessary.
2023-07-07 15:56:54 -07:00
Sylvain aab3cbf207 SDL_thread.h: fix parameter name in comment 2023-07-07 21:55:20 +02:00
Sylvain 6763369f5b gendynapi.py: always check comment formatting of the public api 2023-07-07 21:55:20 +02:00
Frank Praznik b82d6b8e4e wayland: Set the source surface of the request when raising a window
The xdg_activation token requires specifying the surface that is the source of the activation request, not the surface of the target window. Setting this to the target window was causing raise requests to be blocked by the compositor, as if the surface noted as the origin of the request didn't currently have focus, it appeared to the compositor as though it was trying to 'steal' focus.
2023-07-07 14:30:02 -04:00
Mathieu Eyraud bcf239e413 Improve sensor detection for Linux gamepad v2
Detecting by name such as "Accelerometer and "Motion Sensor" may be too broad.
Sensors on Dualshock and Switch gamepad are correctly detected by SDL_EVDEV_GuessDeviceClass(). 
Use vendor and product ID for Wii extension controls.
2023-07-07 10:57:45 -07:00
Sam Lantinga ed6dc1cc05 Prefer using XInput for rumble over WGI, as it allows rumble in the background
(cherry picked from commit e16a83d393ae1784040519f42c482e2641b971a2)
2023-07-07 09:48:58 -07:00
Sam Lantinga 9f19b2bd97 Continue running XInput detection while RAWINPUT is active
This allows us to re-enable XInput correlation for RAWINPUT devices without reintroducing the controller shutdown bug for controllers using the wireless adapter in https://github.com/libsdl-org/SDL/issues/3468.

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

(cherry picked from commit a0a3957eb65e22721a124476072af0f6f5a7ca18)
2023-07-07 09:48:58 -07:00
Sylvain ec90c2e26d Add 'return' comment to SDL_ClearClipboardData 2023-07-07 10:25:06 +02:00
Sam Lantinga d57249034a Fix Cocoa_RaiseWindow activating the app when SDL_HINT_WINDOW_ACTIVATE_WHEN_RAISED is false 2023-07-06 18:14:37 -07:00
Sam Lantinga c5bd2cba98 Fix passing of child window focus in WIN_ShowWindow/WIN_RaiseWindow
Keyboard focus was being passed to the child window being shown if SDL_HINT_WINDOW_ACTIVATE_WHEN_SHOWN is false and keyboard focus was not being passed to the child window being activated in WIN_RaiseWindow.
2023-07-06 18:14:34 -07:00
Sam Lantinga 565e95ac4e Fix windows created with SDL_WINDOW_MINIMIZED having inconsistent SDL_WINDOW_HIDDEN flag on Windows
- Windows created minimized are shown with SW_SHOWMINNOACTIVE which does not send WM_SHOWWINDOW leaving the window visible (but minimized)
  on desktop but still with the SDL_WINDOW_HIDDEN flag set. Now the hidden flag is cleared in this case but noted that this means it's not currently possible
  to create a window that is initially hidden that then is minimized once shown.
2023-07-06 18:14:27 -07:00
Sam Lantinga be79f62cb7 Fixed warning C4214: nonstandard extension used: bit field types other than int 2023-07-06 18:14:22 -07:00
Takase cb55ce70f0
video(wayland): use both --icon and --icon-name for Zenity (#7897)
video(wayland): use both --icon and --icon-name for Zenity

Many distros ship an older version of Zenity that supports GTK3, while some distros ship newer version of Zenity which uses libadwaita.

This command tries to use --icon and fall back to --icon-name when it fails.
2023-07-06 17:53:00 -07:00
Sam Clegg b42cb1c6f2
emscripten: Add JS library dependencies using EM_JS_DEPS macro
See https://github.com/emscripten-core/emscripten/pull/19780

(cherry picked from commit 042243471fb7ecf6ba5e53f0ba35e825a8bb066a)
2023-07-06 19:32:05 -04:00
Sam Lantinga 95033e87e1 SDL 3.0 video modes are sized in points, with a separate pixel density 2023-07-06 15:19:17 -07:00
Sam Lantinga dda474504f Fixed prototype definition 2023-07-06 13:00:03 -07:00
Sam Lantinga 1528e7c3c9 Fixed mapping a controller other than the first one 2023-07-06 12:36:26 -07:00
Frank Praznik 1bf7898ddf wayland: Remove leftover debug message 2023-07-06 13:56:22 -04:00
Frank Praznik d28e9960ce wayland: Use the implicit grab serial for setting the clipboard/primary selection data
Use the implicit grab serial, which includes keyboard key, mouse button, touch, and tablet tool events, for setting the clipboard and primary selection data, as these are all considered valid originating event serials.
2023-07-06 13:52:04 -04:00
Sam Lantinga badb7f1e8b Added notes about delayed clipboard rendering on Windows 2023-07-06 08:36:49 -07:00