InputBind

data class InputBind(val boundKey: InputConstants.Key, val action: InputBind.BindAction, val modifiers: Set<InputBind.Modifier>) : Record

Data class representing a key binding. It holds the key to be bound and the action that will be triggered by the binding.

Parameters

boundKey

The key that is bound to an action.

action

The action triggered by the bound key (e.g., TOGGLE, HOLD).

Constructors

Link copied to clipboard
constructor(boundKey: InputConstants.Key, action: InputBind.BindAction, modifiers: Set<InputBind.Modifier>)
constructor(type: InputConstants.Type, code: Int, action: InputBind.BindAction)

Alternative constructor to create a binding from the key type and key code.

constructor(name: String)

Constructor to create a binding using a key name.

Types

Link copied to clipboard

Action mode used to interpret bind input events.

Link copied to clipboard
object Companion
Link copied to clipboard

Properties

Link copied to clipboard
Link copied to clipboard
val boundKey: InputConstants.Key
Link copied to clipboard

Checks if the key is unbound (i.e., set to UNKNOWN_KEY).

Link copied to clipboard

Retrieves the name of the key in uppercase format, excluding the category prefixes.

Link copied to clipboard

Functions

Link copied to clipboard
fun getNewState(event: KeyboardKeyEvent, currentState: Boolean): Boolean

Handles the event. Returns the new state, assumes the original state is false.

Link copied to clipboard
fun matchesKey(keyCode: Int, scanCode: Int): Boolean

Determines if the specified key matches the bound key.

Link copied to clipboard

Determines if a keyboard press event matches this bind key and required modifiers.

Link copied to clipboard

Determines if a keyboard release affects this bind key or one of its required modifiers.

Link copied to clipboard

Determines if the given modifiers match the required modifiers.

Link copied to clipboard

Determines if the specified mouse button code matches the bound key.

Link copied to clipboard

Determines if a mouse press event matches this bind button and required modifiers.

Link copied to clipboard

Determines if a mouse release affects this bind button or one of its required modifiers.

Link copied to clipboard
fun InputBind.renderText(): Component