It would be easy to assume that all APIs that reference
SDL_JOYSTICK_AXIS_MAX work the same way, but they do not: triggers
generally use the full signed 16-bit range in the lower-level joystick
API, but are normalized to be non-negative by the higher-level gamepad
API.
We also never said explicitly which direction is positive here.
Experimentally, it's right (X), down (Y), and pressed (triggers).
Resolves: https://github.com/libsdl-org/SDL/issues/8793
Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit 059fb560ba98df5668e1cf1c88560b3156e0fb66)
This better reflects the actual implementation and makes SDL_HINT_ENABLE_SCREEN_KEYBOARD work on Android.
Fixes https://github.com/libsdl-org/SDL/issues/8652
(cherry picked from commit 014a63b4b5b94ce50f329eddb345f5434654305b)
The ARM926EJ-S Technical Reference Manual states:
> You can only access CP15 registers with MRC and MCR instructions in a
> privileged mode. CDP, LDC, STC, MCRR, and MRRC instructions, and unprivileged
> MRC or MCR instructions to CP15 cause the Undefined instruction exception to
> be taken.
Furthermore, `MCR p15, 0, <Rd>, c7, c10, 5` (later called Data Memory Barrier)
is not specified for the ARM926. Thus, SDL should not use these cache
instructions on ARMv5.
(cherry picked from commit 139a0931a3ee9808f13e7faecdf9fc4590348f9e)
(cherry picked from commit 46de6241d79c6f4531dbb729b2ed5992ec61b4a2)
(cherry picked from commit 0bd77a5b93494ca88bfd1a86fe106e7bb1d90133)
(cherry picked from commit f341c06552c8618c1178287880fcb8775decfbd3)
(cherry picked from commit 4d2f9f3a324884add7245e8cd13ee06af907c306)
(cherry picked from commit 06f8f9a891194d86ff93a5856f80510d39b75272)
(cherry picked from commit 0c4cb3d1539fefa66c05d131385e35fb2a205fa3)
(cherry picked from commit 0dad56354ceb4222be569e6969475adeec5a1ca1)
When cross-compiling, pkg.m4 will set the PKG_CONFIG variable
to a suitable pkg-config executable, which might be a
host-architecture-prefixed name like aarch64-linux-gnu-pkg-config. This
ensures that we will use a suitable search path that is suitable for
the host architecture (the machine we are compiling for) rather than
the build architecture (the machine we are compiling on) to find
dependency libraries like SDL. When using pkg-config as a substitute
for sdl2-config, we will similarly need to use the
host-architecture-prefixed pkg-config.
Setting the PKG_CONFIG environment variable is also the canonical way to
request that a different pkg-config implementation be used, if that
becomes necessary for some reason.
Co-authored-by: Helmut Grohne <helmut@subdivi.de>
Bug-Debian: https://bugs.debian.org/1059749
Signed-off-by: Simon McVittie <smcv@collabora.com>
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.
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)
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)
XInputGetCapabilitiesEx (ordinal 108) is available in XInput 1.4 that is shipped with Windows 8 and newer.
(cherry picked from commit 08a7ca4d53ef0d504ec780936fd65616fe3a9f09)
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)