TouchscreenDevice class final
A touch screen: the first finger as TouchscreenControls, and every finger in touches for game code that wants them.
- Inheritance
-
- Object
- InputDevice
- StatefulDevice<
TouchState> - TouchscreenDevice
Constructors
- TouchscreenDevice({required int deviceId})
Properties
- applied ↔ TouchState
-
getter/setter pairinherited
- appliedState → Object
-
no setterinherited
- connected ↔ bool
-
False once it has gone. A player holding a device that went is waiting
for it to come back.
getter/setter pairinherited
-
controls
→ List<
InputControl> -
Every control a binding can name on this device, children included.
no setteroverride
- deviceId → int
-
Unique for the session. A pad that is unplugged and plugged back in is
a new device with a new id.
finalinherited
- displayName ↔ String
-
What a player sees:
Xbox Wireless Controller.getter/setter pairinherited - hashCode → int
-
The hash code for this object.
no setterinherited
- layout → String
-
A layout name:
Keyboard,Gamepad.finalinherited - live ↔ TouchState
-
getter/setter pairinherited
- liveState → Object
-
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- settings ↔ InputSettingsDef Function()
-
Asset settings the device reads — dead zones.
getter/setter pairinherited
- sink ↔ DeviceSink?
-
Set by the service that owns this device.
getter/setter pairinherited
-
touches
→ Map<
int, Offset> -
Every finger down now, by pointer id.
no setter
Methods
-
applyNext(
) → void -
Applies the oldest queued change to the applied state. The service
calls this once per queued change, in order.
inherited
-
beginUpdate(
) → bool -
Called at the start of every update, before the queue is replayed:
clears what only lasts one update (mouse movement, wheel). True when
something changed.
override
-
control(
String name) → InputControl? -
The control called
name—space,leftStick/up— or null.override -
handlePointerEvent(
PointerEvent event) → void -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
queue(
void change(TouchState state)) → void -
Makes
changenow to the live state, and queues it for the applied state. With no service yet, both change at once.inherited -
settle(
) → void -
Brings the applied state level with the live one without replaying —
for a device that was just added, whose history nobody needs.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited