Feature request: get info about connected gamepads
LOVE has a really nice joystick API where you can getJoysticks()
to return a table of the connected joystick
objects.
You can then use joystick:getName()
and it will return a value like XBox 360 Controller
or 8Bitdo SN30 Pro
.
I think this would be useful for:
- Giving feedback to the player about what devices the game is seeing and utilizing.
- We can use the gamepad name to automatically configure bindings. For example, the Xbox 360 controller is very common, so our game script can detect it (
if joystick:get_name() == "Xbox 360 Controller"
) and automatically bind button 0 to "action", button 2 to "attack", etc.
(It's possible I'm undersimplifying USB gamepads, but this is my theory)