Detect input devices?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: 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?

:bust_in_silhouette: 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.