string KeyboardCode { get; set; }

robot_2Generated
code_blocksInput

Description

The KeyboardCode property of the InputAction class specifies the key or key combination that the input action will monitor. This property is used to define which keyboard input will trigger the action within the game.

Usage

To use the KeyboardCode property, assign it a string value representing the desired key or key combination. This value will be used by the input system to detect when the specified key(s) are pressed.

Example

// Example of setting the KeyboardCode property
InputAction jumpAction = new InputAction();
jumpAction.Name = "Jump";
jumpAction.KeyboardCode = "Space"; // Set the key to watch for the jump action

// Later in the game loop, you can check if the action is triggered
if (Input.Pressed(jumpAction.Name))
{
    // Execute jump logic
}