Skip to content

Implement SDL_GetPenDeviceType() for Android #13264

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Susko3
Copy link
Contributor

@Susko3 Susko3 commented Jun 23, 2025

Description

This adds the function SDL_GetPenDeviceType() and the accompanying SDL_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 return SDL_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)

@slouken slouken requested a review from icculus June 23, 2025 22:54
@slouken slouken added this to the 3.4.0 milestone Jun 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Proposal] API to query whether SDL_Pen devices are internal or external
2 participants