CarpenterHotkeyScope class final

Keyboard interaction scope that installs command shortcuts, optionally tracks pressed keys, and exposes hotkey state to descendants.

Inheritance

Constructors

CarpenterHotkeyScope({Key? key, required Widget child, List<CarpenterCommand<void>> commands = const [], CarpenterHotkeyCommandCallback? onCommand, CarpenterHotkeyController? controller, TargetPlatform? platform, bool enabled = true, bool trackPressedKeys = true, bool autofocus = true})
Creates a hotkey scope. Commands are empty and tracking/autofocus are enabled by default; supplying a controller leaves its lifecycle with the caller.
const

Properties

autofocus bool
Whether the hotkey focus node requests focus automatically when the scope is built.
final
child Widget
Content wrapped by this hotkey interaction scope.
final
commands List<CarpenterCommand<void>>
Commands exposed to shortcuts and diagnostic descendants.
final
controller CarpenterHotkeyController?
Optional externally owned controller; when omitted the scope creates and owns one.
final
enabled bool
Whether this hotkey scope installs shortcuts and reacts to hardware-key events. When false, descendants remain mounted but no command shortcuts are bound.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onCommand CarpenterHotkeyCommandCallback?
Optional callback notified before a command is invoked by the hotkey surface.
final
platform TargetPlatform?
Target platform used for platform-sensitive shortcut selection and formatting.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
trackPressedKeys bool
Whether the active hotkey scope records the current hardware key set for diagnostics or UI.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<CarpenterHotkeyScope>
Creates the state object that owns hardware-key observation and an internal controller when no controller is supplied.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
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
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

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

Static Methods

commandsOf(BuildContext context) List<CarpenterCommand<void>>
Returns the command list exposed by the nearest hotkey scope.
controllerOf(BuildContext context) CarpenterHotkeyController
Returns the controller owned or supplied by the nearest hotkey scope.
formatterOf(BuildContext context) CarpenterHotkeyFormatter
Returns the platform-aware formatter exposed by the nearest hotkey scope.
snapshotOf(BuildContext context) CarpenterHotkeySnapshot
Returns the latest hotkey snapshot from the nearest scope and establishes an inherited dependency.