Is there a way to programmatically detect whether or not the system my game is running on is using multi-touch or a mouse? Or, whether or not a keyboard is plugged in?
I understand I can get the OS with:
In the case that the
system_name is HTML5, I would like to run the application differently on tablets and desktop browsers.
For example, a twin stick shooter might use two virtual-analog sticks on a tablet, but on a desktop I would want to use WASD / Mouse.
If I can detect the presence of a keyboard or mouse, I could run the application in “Desktop” mode.
Taking it one step further: if it’s on a tablet OR desktop with a gamepad, I would prefer to use the gamepad twin-stick controls.