FlixelGamepadDetector
View sourceclass
org.flixelgdx.input.gamepad.FlixelGamepadDetector
public final class FlixelGamepadDetector
Maps a controller name string (for example from Controller.getName()) to a FlixelGamepadModel. Intended for connect-time use only; do not call from per-frame hot paths.
Matching uses ordered substring checks on a once-normalized lowercase name. Add new literal fragments when you encounter unknown devices in the wild, keeping more specific fragments before broader ones.
Methods
detect(Controller)
public static FlixelGamepadModel detect(Controller controller)
Detects the best FlixelGamepadModel for the given controller.
Parameters:
| Name | Description |
|---|---|
controller | The controller to detect, or null. |
Returns: Never null; FlixelGamepadModel.UNKNOWN when no rule matches.
detect(String)
public static FlixelGamepadModel detect(String controllerName)
Detects the best FlixelGamepadModel for the given controller name.
Parameters:
| Name | Description |
|---|---|
controllerName | Raw name from the backend, or null. |
Returns: Never null; FlixelGamepadModel.UNKNOWN when no rule matches.