RawKeyEvent class abstract

Defines the interface for raw key events.

This type of event has been deprecated, and will be removed at a future date. Instead of using this, use the KeyEvent class instead, which means you will use Focus.onKeyEvent, HardwareKeyboard and KeyboardListener to get these events instead of the raw key event equivalents.

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
  • @Deprecated('Use KeyEvent instead. ' 'This feature was deprecated after v3.18.0-2.0.pre.')
  • @immutable

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.
no setterinherited
isAltPressed bool
Returns true if a ALT modifier key is pressed, regardless of which side of the keyboard it is on.
no setter
isControlPressed bool
Returns true if a CTRL modifier key is pressed, regardless of which side of the keyboard it is on.
no setter
isMetaPressed bool
Returns true if a META modifier key is pressed, regardless of which side of the keyboard it is on.
no setter
isShiftPressed bool
Returns true if a SHIFT modifier key is pressed, regardless of which side of the keyboard it is on.
no setter
logicalKey LogicalKeyboardKey
Returns an object representing the logical key that was pressed.
no setter
physicalKey PhysicalKeyboardKey
Returns an object representing the physical location of this key.
no setter
repeat bool
Whether this is a repeated down event.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
override
isKeyPressed(LogicalKeyboardKey key) bool
Returns true if the given LogicalKeyboardKey is pressed.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent 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