RawKeyEvent class Null safety

Defines the interface for raw key events.

Raw key events pass through as much information as possible from the underlying platform's key events, which allows them to provide a high level of fidelity but a low level of portability.

The event also provides an abstraction for the physicalKey and the logicalKey, describing the physical location of the key, and the logical meaning of the key, respectively. These are more portable representations of the key events, and should produce the same results regardless of platform.

See also:

Mixed in types
Implementers
Annotations

Constructors

RawKeyEvent({required RawKeyEventData data, String? character, bool repeat = false})
Abstract const constructor. This constructor enables subclasses to provide const constructors so that they can be used in const expressions.
const
RawKeyEvent.fromMessage(Map<String, Object?> message)
Creates a concrete RawKeyEvent class from a message in the form received on the SystemChannels.keyEvent channel.
factory

Properties

character String?
Returns the Unicode character (grapheme cluster) completed by this keystroke, if any.
final
data RawKeyEventData
Platform-specific information about the key event.
final
hashCode int
The hash code for this object.
read-onlyinherited
isAltPressed bool
Returns true if a ALT modifier key is pressed, regardless of which side of the keyboard it is on.
read-only
isControlPressed bool
Returns true if a CTRL modifier key is pressed, regardless of which side of the keyboard it is on.
read-only
isMetaPressed bool
Returns true if a META modifier key is pressed, regardless of which side of the keyboard it is on.
read-only
isShiftPressed bool
Returns true if a SHIFT modifier key is pressed, regardless of which side of the keyboard it is on.
read-only
logicalKey LogicalKeyboardKey
Returns an object representing the logical key that was pressed.
read-only
physicalKey PhysicalKeyboardKey
Returns an object representing the physical location of this key.
read-only
repeat bool
Whether this is a repeated down event.
final
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited

Methods

debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
override
isKeyPressed(LogicalKeyboardKey key) bool
Returns true if the given KeyboardKey is pressed.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringShort() String
A brief description of this object, usually just the runtimeType and the hashCode.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited