enum InputEventKind
Swift
enum InputEventKind
Mirrors canvas::InputEventKind.
Sources/LavaUI/Input.swift:111
Cases
case none
Not documented.
Sources/LavaUI/Input.swift:112
case mouseDown
x/y = window position, button = which button, mods = held
modifier keys (see InputEvent.mods).
Sources/LavaUI/Input.swift:115
case mouseUp
Not documented.
Sources/LavaUI/Input.swift:116
case mouseMove
Not documented.
Sources/LavaUI/Input.swift:117
case resize
Framebuffer size changed; x/y are new width/height.
Sources/LavaUI/Input.swift:119
case key
Keyboard; button = key, x = action, y = mods.
Sources/LavaUI/Input.swift:121
case text
A committed character; button holds the Unicode scalar. Distinct from
key, which is physical and says nothing about layout or dead keys.
Sources/LavaUI/Input.swift:124
case scroll
Wheel / trackpad; x/y are deltas in notches, button holds mods.
Sources/LavaUI/Input.swift:126
case refresh
Window needs a redraw (expose, un-minimize, compositor damage).
Sources/LavaUI/Input.swift:128
case fileDrop
Files dropped on the window. x/y = cursor position, button =
path count; the paths themselves come from Editor.droppedFile(at:)
while handling this event — the next drop overwrites them.
Sources/LavaUI/Input.swift:132
case nodeScroll
A scene node the renderer owns has moved. button = node id, x/y
= its scroll offset.
The read path for renderer-owned state: the decision to scroll never reaches this process, which is what lets it happen while this process is stopped, but the result comes back — because a list that does not know which rows are on screen cannot virtualize.
Coalesced per node, so an animating scroll costs one event per frame rather than one per step. Ignoring it entirely is fine and obliges nothing.
Sources/LavaUI/Input.swift:144
case nodeAnimationDone
A node finished the animation this process declared for it.
button = node id.
The other half of declaring a target: having said "move there" and stopped thinking about it, this is the only way to learn it arrived. Sequencing one transition after another is the ordinary reason to want that — a timer here would be a second copy of the renderer's clock, running in a process that may not be scheduled when it matters.
Sources/LavaUI/Input.swift:154
case nodeHover
The node under the pointer changed. button = node id, 0 for none.
The renderer hit-tests to draw its tints, so it already knows. Without this the app would hit-test the same geometry again from coordinates — and get it wrong for any node the renderer has scrolled or animated, since that node is no longer where the app declared it.
A click is this plus the .mouseDown queued immediately after it.
Sources/LavaUI/Input.swift:163
case pointerLeave
The pointer left this window. No payload — see PointerLeave in
draw_command.hpp.
Sources/LavaUI/Input.swift:166
case windowState
The window was maximized or restored. button = 1 maximized, 0
restored. See WindowState in draw_command.hpp.
Sources/LavaUI/Input.swift:169
case dragOver
A drag offering files is over this window at x/y. See DragOver
in draw_command.hpp — and View.onDrop(targeted:springLoaded:perform:),
which is what it drives.
Sources/LavaUI/Input.swift:173
case dragLeave
The drag left this window, or ended anywhere. No payload.
Sources/LavaUI/Input.swift:175