LavaUI docs GitHub

struct InputEvent

Swift

struct InputEvent

One polled event from Editor.pollInputEvent.

Sources/LavaUI/Input.swift:293

Constructors

init(kind: InputEventKind, x: Float, y: Float, button: Int32, mods: Int32 = 0)

Creates an event.

Sources/LavaUI/Input.swift:308

Properties

var button: Int32

Integer payload. Its meaning depends on kind.

Sources/LavaUI/Input.swift:301

var keyAction: Float { get }

For a .key event, the action (KeyAction).

Sources/LavaUI/Input.swift:319

var keyCode: Int32 { get }

For a .key event, the key code (KeyCode).

Sources/LavaUI/Input.swift:317

var keyMods: Int32 { get }

For a .key event, the modifier bits (KeyMods).

Sources/LavaUI/Input.swift:321

var kind: InputEventKind

What happened; decides how the other fields read.

Sources/LavaUI/Input.swift:295

var mods: Int32

GLFW modifier bitfield (see KeyMods). Only populated for .mouseDown/.mouseUp — .scroll already carries mods in button, .key carries them in y.

Sources/LavaUI/Input.swift:305

var x: Float

First payload value. Its meaning depends on kind.

Sources/LavaUI/Input.swift:297

var y: Float

Second payload value. Its meaning depends on kind.

Sources/LavaUI/Input.swift:299