Skip to content
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

Ability to detect if touch input is available #13126

Open
inodentry opened this issue Apr 28, 2024 · 0 comments
Open

Ability to detect if touch input is available #13126

inodentry opened this issue Apr 28, 2024 · 0 comments
Labels
A-Input Player input via keyboard, mouse, gamepad, and more C-Enhancement A new feature

Comments

@inodentry
Copy link
Contributor

What problem does this solve or what need does it fill?

I would like my game to set up the UI a little differently if running on a device with a touchscreen. Enable some additional touch-only features, etc.

It would be very convenient if there was an API to detect if a touchscreen is present.

What solution would you like?

Some sort of Resource that can be checked to indicate if the system the app is running on has a touchscreen / could provide touch input events.

Maybe also a predefined run condition for it.

What alternative(s) have you considered?

Well, my current workaround is to have a "setting" in my game for whether touch-specific features are enabled. I can make it default to true for Android/iOS builds and false otherwise (but allowing the user to enable it in the game's settings).

Or I could assume a touchscreen is not available at first and have a system that can rebuild / setup the UI for touch as soon as it detects a Touch event at runtime.

It would still be much nicer if there was a way to detect the existence of a touch input ahead of time, though.

@inodentry inodentry added C-Enhancement A new feature A-Input Player input via keyboard, mouse, gamepad, and more labels Apr 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Input Player input via keyboard, mouse, gamepad, and more C-Enhancement A new feature
Projects
None yet
Development

No branches or pull requests

1 participant