Commit graph

297 commits

Author SHA1 Message Date
Sam Lantinga 1db0bd3fc0 Added support for the HP HyperX Clutch Gladiate controller
(cherry picked from commit f52b330ed84c477a94094302aa6a3baaca87019d)
2023-10-25 09:01:46 -07:00
Sam Lantinga 862a654b70 Accept key events from any source
This allows TV remotes to navigate SDL applications (with source HDMI)

Fixes https://github.com/libsdl-org/SDL/issues/8137
2023-08-24 10:11:53 -07:00
Sam Lantinga 8e27a69370 Updated to Android minSdkVersion 19 and targetSdkVersion 34
This is updated to meet the latest requirements for apps on the Google Play store
2023-08-24 08:26:05 -07:00
Sam Lantinga ceece918e4 Updated to version 2.29.0 for development 2023-06-20 11:50:19 -07:00
Sam Lantinga ffa78e6bea Updated to version 2.28.0 for release 2023-06-20 11:00:20 -07:00
Sam Lantinga d4f9be4416 Updated to version 2.27.1 for release candidate 2023-06-13 19:44:26 -07:00
Sam Lantinga 92f72682e7 Document the Android SDK versions checked in Java code
(cherry picked from commit b48b1ce50042168c5b9b310fa495cb355903c241)
2023-05-23 08:45:43 -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 c971795954bc85086cd20cfc71b45a311b7ba0d1)
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 3f6b2d1a61d0c0dcd6af7cc951c1d8c267ed1526)
2023-05-22 12:01:52 -07:00
Sam Lantinga e8ec8ba1d4 Added support for the Astro C40 in Xbox 360 mode
(cherry picked from commit a4b4dff4a2998699757f12d29fdd4c632db884fe)
2023-05-19 14:23:57 -07:00
Bartłomiej Dach 576df87240 Android: Fix missing type in SDLControllerManager
The missing type in question is causing compilation failures.
The error was introduced in dca3fd8307,
which was a backport of commit de3909a190f6e1a3f11776ce42927f99b0381675
from SDL3 to SDL2.

Because `int nballs` was removed as a parameter from the controller
API in SDL3 in revision fcafe40948fe308cc9552df5a3d625ee2725de5a,
this change is only applicable to the SDL2 branch.
2023-03-25 15:08:33 -07:00
Rudolf Polzer dca3fd8307 Android: indicate gamepaddb entries where axis order changed.
Axis order was changed in 6f1f586086a18ab32ddccc05e4616aac02774a1b to improve
default mappings.

(cherry picked from commit de3909a190f6e1a3f11776ce42927f99b0381675)
2023-03-11 13:01:50 -08:00
divVerent 91ad208d18 Fix Xbox One gamepad axis assignment on SDL_JOYSTICK_ANDROID API (#7405)
(cherry picked from commit 6f1f586086a18ab32ddccc05e4616aac02774a1b)
2023-03-06 15:37:41 -08:00
Sam Lantinga 3dff5d3cbe Added support for the Turtle Beach REACT-R and Recon Xbox controllers
(cherry picked from commit 5fded632d6fa532ac25e76ad9a676c9ea726dd02)
2023-02-21 11:29:45 -08:00
Wohlstand b425036808 SDLAudioManager.java: Fixed the support for Android older than API 23 2023-01-10 20:15:35 -08:00
Sam Lantinga a099172754 Added support for the ThrustMaster eSwap PRO Controller Xbox
(cherry picked from commit 0357390fc2dcc7c772ac3041c1148882f6fe2137)
2023-01-03 15:24:32 -08:00
Sylvain 2fd9e63f1a
Android: orientation, check for exact match to "Portrait". (see #6959)
(Portrait is also contained in PortraitUpsideDown)
2023-01-02 09:48:26 +01:00
Sylvain 874ebed14d
Android: inverse LandscapeLeft and LandscapeRight (see #6959)
LandscapeLeft has now been set to ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE and LandscapeRight to ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE in order to reflect the docs: https://wiki.libsdl.org/SDL2/SDL_HINT_ORIENTATIONS
2023-01-02 09:48:17 +01:00
Sylvain Becker 36c87d9f27
Android JAVA DetectDevices: 'is_capture' is inverted (#6845)
* Android JAVA DetectDevices: 'is_capture' is inversed
* Android Audio: adding audio device. also inverted capture, from jni side
2022-12-18 16:56:43 +01:00
Maido 741499dea7
Android audio device selection (#6824)
Make it possible to select a specific audio device for Android
2022-12-16 16:38:57 +01:00
Sam Lantinga a937b5c4ad Add 8BitDo to the list of Xbox 360 third party vendors
Allows detection of the 8BitDo Ultimate Wired Controller
2022-11-28 13:47:30 -08:00
Sam James 4c7156c1e6 Avoid use of deprecated egrep/fgrep
GNU grep 3.8 emits a deprecation warning on use of egrep/fgrep.

Signed-off-by: Sam James <sam@gentoo.org>
(cherry picked from commit 3e7952ce8a0affd325c802755cae5fd843b86d99)
2022-11-24 02:59:41 -08:00
Sam Lantinga ea8f8b6dc3 Updated to version 2.27.0 for development 2022-11-21 16:36:10 -08:00
Sam Lantinga 0bfeed061b Updated to version 2.26.0 for release 2022-11-21 16:15:58 -08:00
Sam Lantinga 78ea6af2cd Updated to version 2.25.1 for release candidate 2022-11-17 09:01:35 -08:00
Sam Lantinga b4aba10154 Reverted game controller buttons from interacting with message box dialogs
These would only work for non-HIDAPI controllers, and other controller input would leak past the dialog, both of which would be confusing.
2022-10-06 12:10:46 -07:00
Sam Lantinga 893c87b27b Fixed game controller buttons being unresponsive when the on-screen keyboard is up
Also mapped controller A and B buttons to interact with messagebox dialogs
2022-10-06 12:10:45 -07:00
Sylvain fdef96e233
Android: remove "nativeSetComposingText" since it's not used anymore
(and it may fail registering at init if code is cleaned with proguard)
2022-10-04 12:08:09 +02:00
Sam Lantinga 5291e5cb76 Added version checking to SDLActivity.java
Make sure the SDL java and C code match when updating SDL in a game.
Right now we're assuming that we only have to make sure release versions match. We can extend the version string with an interface version if we need more fine grained sanity checking.

Fixes https://github.com/libsdl-org/SDL/issues/1540
2022-10-03 17:36:17 -07:00
Sam Lantinga 6acc7a5622 Mark the editbox as multi-line so the return key is always visible
Fixes https://github.com/libsdl-org/SDL/issues/6170
2022-09-30 17:45:08 -07:00
Sam Lantinga 257cacab18 Android text input now works like iOS, where you get text in progress and then backspaces and new text if autocomplete changes it or the IME commits it. 2022-09-30 17:25:58 -07:00
Sam Lantinga 82e341bc9e Android: use real editable text and mimic the edit operations to generate key events
This fixes issues where the IME and the output would get out of sync
2022-09-30 11:40:29 -07:00
yurii levchenko 3ce3594e38 Split SDLSurface to public class
Add SDLActivity method createSDLSurface
2022-08-22 14:57:15 -07:00
Sam Lantinga be3a945a8b Added support for the 8BitDo Ultimate Wired Controller for Xbox 2022-07-20 11:05:55 -07:00
Sam Lantinga 986818143d Fixed missing imports in SDLActivity (thanks @guusw!) 2022-07-18 07:20:58 -07:00
Sam Lantinga 27d8cbf026 Added PowerA and Qanba vendors for Android USB device support 2022-07-12 18:18:00 -07:00
Sam Lantinga 209f457ea4 Generate backspaces for the text we're going to replace when committing text 2022-07-01 10:13:19 -07:00
Sam Lantinga 7ac5d616f3 Fixed backspace being delivered after committed text on Android 12
Testing:
Enter "hello ", followed by "?" - the events generated are:
: commitText hello
: Key pressed :  scancode 11 = H, keycode 0x00000068 = H  modifiers: (none)
: Key released:  scancode 11 = H, keycode 0x00000068 = H  modifiers: (none)
: Key pressed :  scancode 8 = E, keycode 0x00000065 = E  modifiers: (none)
: Key released:  scancode 8 = E, keycode 0x00000065 = E  modifiers: (none)
: Key pressed :  scancode 15 = L, keycode 0x0000006C = L  modifiers: (none)
: Key released:  scancode 15 = L, keycode 0x0000006C = L  modifiers: (none)
: Key pressed :  scancode 15 = L, keycode 0x0000006C = L  modifiers: (none)
: Key released:  scancode 15 = L, keycode 0x0000006C = L  modifiers: (none)
: Key pressed :  scancode 18 = O, keycode 0x0000006F = O  modifiers: (none)
: Key released:  scancode 18 = O, keycode 0x0000006F = O  modifiers: (none)
: Key pressed :  scancode 44 = Space, keycode 0x00000020 = Space  modifiers: (none)
: Key released:  scancode 44 = Space, keycode 0x00000020 = Space  modifiers: (none)
: INPUT Text (\x68\x65\x6c\x6c\x6f\x20): "hello "
: finishComposingText
: deleteSurroundingText 1 / 0
: Key pressed :  scancode 42 = Backspace, keycode 0x00000008 = Backspace  modifiers: (none)
: Key released:  scancode 42 = Backspace, keycode 0x00000008 = Backspace  modifiers: (none)
: commitText ?
: Key pressed :  scancode 225 = Left Shift, keycode 0x400000E1 = Left Shift  modifiers: LSHIFT
: Key pressed :  scancode 56 = /, keycode 0x0000002F = /  modifiers: (none)
: Key released:  scancode 56 = /, keycode 0x0000002F = /  modifiers: (none)
: Key released:  scancode 225 = Left Shift, keycode 0x400000E1 = Left Shift  modifiers: (none)
: INPUT Text (\x3f): "?"
: setComposingText , at 1
: EDIT Text (): ""

Previously, the backspace would be delivered after the "?"
2022-07-01 08:58:08 -07:00
Sam Lantinga 37a517dc36 Re-enable IME text input on Android
In my testing, this results in text edit events followed by text input events. Any ASCII characters will generate scancode events based on a hypothetical US keyboard layout.

Fixes https://github.com/libsdl-org/SDL/issues/3377
2022-07-01 08:33:31 -07:00
Wohlstand 68beedde92 SDLActivity.java: Compatibility fix for debugSource
I did these fixes a while ago while debuggin my application, however, forgot to send them back.
2022-06-16 12:45:15 -07:00
staphen 123b9aaa41 Adjust gradle dependencies to enable the build to position assets for the APK 2022-03-15 21:57:25 -07:00
Sylvain 5b41844c75
Fixed bug #5322 - register virtual input devices as SDL_Touch device, fix compilation 2022-02-09 09:50:41 +01:00
Sylvain 3a9bbf604e
Fixed bug #5322 - register virtual input devices as SDL_Touch device because
they can send SOURCE_TOUCHSCREEN events even if getSources() doesn't declare them.
2022-02-09 09:37:36 +01:00
Sylvain 59f1e2875a
Android: add debug function to display class/sources 2022-02-08 21:50:19 +01:00
Sylvain 2df2da11f6
Android: handleMotionEvent() is checking for SOURCE_JOYSTICK. So don't handle DPAD GAMEPAD (see #5322, #2718) 2022-02-08 17:51:40 +01:00
Sylvain 1fc5dba3d5
Android: test for SOURCE_KEYBOARD / SOURCE_MOUSE. Don't compare to 0, since there are several bits (see #5322, #2718) 2022-02-08 17:41:17 +01:00
Sylvain f185711203
Fixed bug #5310: Android, Undefined reference to AAssetManager_fromJava 2022-02-08 16:18:01 +01:00
Sylvain 68dd84f1de
Android: TouchDevice -1 is reserved for SDL synthetic devce (See #5322) 2022-02-08 11:42:24 +01:00
Sylvain 14bc3bf4ec
Android: fix typo to register TOUCHSCREEN device (see #5322, #2718) 2022-02-07 22:20:05 +01:00
Temdog007 b59e75c259 Handle menu button press from controller 2022-02-02 21:21:44 -08:00