Skip to content

KeyEvent

data class KeyEvent(
    val keyCode: Int, 
    val scanCode: Int, 
    val modifiers: Int
) : InputEvent

An event generated by a keyboard key press.

Constructors

KeyEvent

constructor(
    keyCode: Int, 
    scanCode: Int, 
    modifiers: Int
)

Properties

keyCode

val keyCode: Int

modifiers

val modifiers: Int

scanCode

val scanCode: Int

Functions

consume

fun consume(bypassSuperCall: Boolean = false)

Marks this event as consumed, stopping further propagation.

Parameters

  • bypassSuperCall: When true, the corresponding screen method will return true instead of delegating to the super implementation. Use this when the UI has fully handled a keyboard or mouse event and the vanilla logic should be suppressed.