ZKeyboardEvent

data class ZKeyboardEvent(val key: String, val code: String, val keyCode: ZKeyCode, val char: String?, val type: ZKeyboardEventType, val timestamp: Long, val ctrlKey: Boolean, val shiftKey: Boolean, val altKey: Boolean, val metaKey: Boolean, val repeat: Boolean)(source)

Represents a keyboard event with key information and modifiers.

Constructors

Link copied to clipboard
constructor(key: String, code: String, keyCode: ZKeyCode, char: String?, type: ZKeyboardEventType, timestamp: Long, ctrlKey: Boolean, shiftKey: Boolean, altKey: Boolean, metaKey: Boolean, repeat: Boolean)

Properties

Link copied to clipboard

Whether the Alt key was pressed

Link copied to clipboard
val char: String?

The character that was typed (for KEY_PRESS events, null otherwise)

Link copied to clipboard

The physical key code string (e.g., "KeyA", "Enter", "ArrowLeft")

Link copied to clipboard

Whether the Ctrl key was pressed

Link copied to clipboard
val key: String

The key value (e.g., "a", "Enter", "ArrowLeft")

Link copied to clipboard

The ZKeyCode enum value for type-safe key checking

Link copied to clipboard

Whether the Meta key (Cmd on Mac, Windows key on Windows) was pressed

Link copied to clipboard

Whether the key is being held down (repeat event)

Link copied to clipboard

Whether the Shift key was pressed

Link copied to clipboard

Event timestamp in milliseconds

Link copied to clipboard

Type of keyboard event