Class FlowGraphIsKeyPressedBlock
Hierarchy (View Summary)
- WebXRSpatialLayerType
- FlowGraphIsKeyPressedBlock
Constructors
constructor
-
Creates a new FlowGraphIsKeyPressedBlock.
Parameters
Optionalconfig: anyoptional configuration
Returns FlowGraphIsKeyPressedBlock
Properties
Readonlyis Pressed
isPressed: FlowGraphDataConnection<boolean>
Output connection: true if the key (and all required modifiers) are currently held down.
Readonlykey
key: FlowGraphDataConnection<string>
Input connection: the KeyboardEvent.code of the key to check
(e.g. "KeyA", "Space", "ShiftLeft").
Readonlywith Alt
withAlt: FlowGraphDataConnection<boolean>
Input connection: when true, Alt (Option on macOS) must also be held.
Readonlywith Command Or Ctrl
withCommandOrCtrl: FlowGraphDataConnection<boolean>
Input connection: when true, the platform-appropriate "command" modifier must also be held (Cmd on macOS, Ctrl on Windows/Linux). This uses the virtual "CommandOrControl" key tracked by the coordinator.
Readonlywith Ctrl
withCtrl: FlowGraphDataConnection<boolean>
Input connection: when true, Ctrl must also be held.
Readonlywith Meta
withMeta: FlowGraphDataConnection<boolean>
Input connection: when true, Meta (Win key / Cmd) must also be held.
Readonlywith Shift
withShift: FlowGraphDataConnection<boolean>
Input connection: when true, Shift must also be held.
A data block that outputs whether a specific keyboard key is currently pressed, optionally requiring one or more modifier keys to also be held.
This block queries the scene event coordinator's
pressedKeysset, which is updated in real-time by the keyboard observers. It is designed to be polled every frame (e.g. from a Scene Tick event chain) but can also be read on demand from any execution context.The
keyinput usesKeyboardEvent.codevalues (e.g. "KeyA", "Space", "ShiftLeft", "ControlLeft", "AltLeft", "MetaLeft" for Mac Cmd).Modifier inputs (
withShift,withCtrl,withAlt,withMeta,withCommandOrCtrl) default to false. Set any to true to require that modifier to also be held forisPressedto be true. For example, key = "KeyA" + withCommandOrCtrl = true checks for Cmd+A on macOS or Ctrl+A on Windows/Linux.