ScriptedPointerLock class final
A PointerLockPlatform a test drives: it grants a capture unless told not to, reports the motion a test moves the mouse by, and loses the capture the way a window loses focus.
As a platform reports. A granted capture and every release, asked
for or not, arrive on stateChanges; a refused one reports nothing and
leaves the pointer free; motion is reported only while the pointer is
held, since a free mouse moves a cursor. calls keeps what the plugin
was asked, in order. Install it with
PointerLockPlatform.instance = ScriptedPointerLock().
- Inheritance
-
- Object
- PlatformInterface
- PointerLockPlatform
- ScriptedPointerLock
Constructors
- ScriptedPointerLock({bool isSupported = true})
-
A platform that can (
isSupported) or cannot capture the pointer.
Properties
-
calls
→ List<
String> -
Every call the plugin made, by name, oldest first.
no setter
-
deltas
→ Stream<
Offset> -
Motion reported since the last capture, in logical pixels.
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- isCaptured → bool
-
Whether the pointer is held now.
no setter
- isSupported → bool
-
False where there is no pointer to capture: a phone or a tablet with no
mouse connected, a touch screen in a browser, and a platform the plugin
has no implementation for.
final
- refuses ↔ bool
-
Whether the next capture is refused, as a browser refuses one with
no user gesture. Settable.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
stateChanges
→ Stream<
CaptureState> -
Each change of capture state the platform reports, including releases
nobody asked for: Escape, a lost focus, a switched tab.
no setteroverride
-
supportChanges
→ Stream<
bool> -
Each change of isSupported after the first read, as its new value.
no setterinherited
Methods
-
capture(
) → Future< void> -
Asks the platform to hide the cursor and hold it in place.
override
-
loseFocus(
) → void - Takes the pointer away unasked, as Escape or a lost focus does.
-
move(
Offset delta) → void -
Moves the mouse by
delta: reported while the pointer is held. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
release(
) → Future< void> -
Asks the platform to show the cursor again and stop reporting motion.
override
-
reset(
) → Future< void> -
Puts the platform back to an uncaptured state regardless of what it thinks
it is doing.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited