Implement SDL_GetPenDeviceType() for Android #13264
Open
+75
−12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This adds the function
SDL_GetPenDeviceType()
and the accompanyingSDL_PenDeviceType
enum as set out in #13065 (please note that the original issue uses 'internal' and 'external', which are 'direct' and 'indirect' respectively in this PR). Only properly implemented on Android, all other platforms will returnSDL_PEN_DEVICE_TYPE_UNKNOWN
.This is implemented on Android via
InputDevice.isExternal()
(Android 10+, API 29+), assuming all external pen devices are indirect.Usage example
This API would be consumed by osu!framework and forwarded to osu! so the game can decide whether or not to show the in-game cursor (the cursor wouldn't be shown for
SDL_PEN_DEVICE_TYPE_DIRECT
).Testing
A previous version of this PR was tested with a USB tablet. The relevant Android API was tested to work as expected on multiple tablets and with a Samsung S Pen.
Existing Issue(s)