Publishes gamepads from the gamepads package, with each pad its own
device.
Raw events go through the package's normalizer first. Events it cannot map fall back to key spellings the demos observed, so an unusual pad still reaches actions. No deadzone is applied here; deadzones live in bindings.
The package reports no connects or disconnects, so the source polls the pad list every pollInterval and on any event from an unknown pad. A returning pad keeps its device handle when its name and position among same-named pads match.
On macOS a HID tap also reports pads the GameController framework never
lists (Steam Input's virtual pad, generic XInput adapters). Pads both
report are kept from the package only. A sandboxed app needs the
com.apple.security.device.usb entitlement for the tap.
- Inheritance
-
- Object
- InputSource
- GamepadSource
Constructors
- GamepadSource({GamepadBackend? backend, GamepadNormalizer? normalizer, HidGamepadBackend? hid, Duration pollInterval = const Duration(seconds: 1), bool hidFallback = true})
-
A source over
backend(default thegamepadspackage).
Properties
-
devices
→ Iterable<
InputDevice> -
Connected pads from the package, by package id.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hidFallback → bool
-
Whether to start the macOS HID tap.
final
- pollInterval → Duration
-
How often the pad list is refreshed.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
attach(
InputSink sink) → void -
Starts publishing into
sink.override -
detach(
) → void -
Stops publishing and releases platform listeners.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
poll(
double deltaSeconds) → void -
Called at the start of each frame, before read windows advance, for
backends that must be polled.
inherited
-
refresh(
) → Future< void> - Re-reads the pad list, connecting and disconnecting devices to match.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited