Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | JulSams |
How do you detect controllers, keyboard(s) and a touchscreen?
Is there any way to tell which input devices are available to the player?
Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | JulSams |
How do you detect controllers, keyboard(s) and a touchscreen?
Is there any way to tell which input devices are available to the player?
Reply From: | Afely |
For detecting controllers, you can do so with the Input
class, using the get_connected_joypads()
method.
As for the touchscreen and keyboard, I believe there is no way to detect them. However, you can use the InputMap
class to get keyboard and controller input, and InputEventScreenTouch
to get touchscreen input.