Skip to main content

FlixelGamepadDetector

View source

class

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:

NameDescription
controllerThe 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:

NameDescription
controllerNameRaw name from the backend, or null.

Returns: Never null; FlixelGamepadModel.UNKNOWN when no rule matches.