Ability to detect if touch input is available
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 161
Description
## 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.
Contributor guide
Assessment
This issue has not been assessed yet.