Input devices

更新时间:
复制 MD 格式

You can configure input device nodes in the blueprint editor to enable keyboard-based interactions. Currently, the keyboard is the only logic node available for input devices.

Keyboard

The Keyboard node listens for keyboard events.

Scenario: Use the Keyboard node for keyboard-based interactions, such as using the arrow keys to move an image.

Add the Keyboard node to the canvas to view its events, actions, and configuration parameters. For more information about how to add nodes, see Use Logic Nodes.

键盘面板
Table 1. Events and actions
Event/Action Description
When any key is pressed Executes the corresponding action when any key on the keyboard is pressed.
When a character key is pressed Executes the corresponding action when a character key on the keyboard is pressed.
When a key is released Executes the corresponding action when a key is released.
Up and Down The default key names. You can add or delete keys. For more information, see Configuration items.
Table 2. Configuration parameters

This table describes the parameters in Other Configurations. For other parameters, see Common parameters.

Parameter Description
Trigger Method Select a trigger method for the keyboard from the drop-down list. Options include the following:
  • keydown: Triggers an event when any key is pressed.
  • keypress: Triggers an event when a character key is pressed.
  • keyup: Triggers an event when any key is released.
Key List Click the 加号图标 or 垃圾桶图标 icon to add or delete a key. The new key appears in the Key List node. Click the 横排列图标 or 竖排列图标 icon to configure the arrangement of multiple keys. Click the 复制图标 icon to copy the selected key's configuration and add a new key with the same settings.
Alias Enter a custom alias for the key. This alias serves as the display name. For example, Up.
Key Value Click Change to customize the trigger key. After the change, pressing the corresponding key triggers the action. For example, Shift+↑.

Outputs: None.