FakeHardwareKeyboard class
A fake HardwareKeyboard, which can be used to simulate keys being pressed while new
keys are pressed, e.g., CMD being pressed when the user then presses C to copy
or V to paste.
- Inheritance
-
- Object
- HardwareKeyboard
- FakeHardwareKeyboard
Constructors
- FakeHardwareKeyboard({bool isAltPressed = false, bool isControlPressed = false, bool isMetaPressed = false, bool isShiftPressed = false})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isAltPressed ↔ bool
-
Returns true if a logical ALT modifier key is pressed, regardless of which
side of the keyboard it is on.
getter/setter pairoverride-getter
- isControlPressed ↔ bool
-
Returns true if a logical CTRL modifier key is pressed, regardless of
which side of the keyboard it is on.
getter/setter pairoverride-getter
- isMetaPressed ↔ bool
-
Returns true if a logical META modifier key is pressed, regardless of
which side of the keyboard it is on.
getter/setter pairoverride-getter
- isShiftPressed ↔ bool
-
Returns true if a logical SHIFT modifier key is pressed, regardless of
which side of the keyboard it is on.
getter/setter pairoverride-getter
-
lockModesEnabled
→ Set<
KeyboardLockMode> -
The set of KeyboardLockMode that are enabled.
no setterinherited
-
logicalKeysPressed
→ Set<
LogicalKeyboardKey> -
The set of LogicalKeyboardKeys that are pressed.
no setterinherited
-
physicalKeysPressed
→ Set<
PhysicalKeyboardKey> -
The set of PhysicalKeyboardKeys that are pressed.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addHandler(
KeyEventCallback handler) → void -
Register a listener that is called every time a hardware key event
occurs.
inherited
-
clearState(
) → void -
Clear all keyboard states and additional handlers.
inherited
-
handleKeyEvent(
KeyEvent event) → bool -
Process a new KeyEvent by recording the state changes and dispatching
to handlers.
inherited
-
isLogicalKeyPressed(
LogicalKeyboardKey key) → bool -
Returns true if the given LogicalKeyboardKey is pressed, according to
the HardwareKeyboard.
override
-
isPhysicalKeyPressed(
PhysicalKeyboardKey key) → bool -
Returns true if the given PhysicalKeyboardKey is pressed, according to
the HardwareKeyboard.
inherited
-
lookUpLayout(
PhysicalKeyboardKey physicalKey) → LogicalKeyboardKey? -
Returns the logical key that corresponds to the given pressed physical key.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeHandler(
KeyEventCallback handler) → void -
Stop calling the given listener every time a hardware key event
occurs.
inherited
-
syncKeyboardState(
) → Future< void> -
Query the engine and update _pressedKeys accordingly to the engine answer.
Both the framework and the engine maintain a state of the current pressed
keys. There are edge cases, related to startup and restart, where the framework
needs to resynchronize its keyboard state.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited