enum InputEventKind
Swift
enum InputEventKind
Mirrors canvas::InputEventKind.
Sources/LavaUI/Input.swift:218
Cases
case none
No event; what a poll returns when the queue is empty.
Sources/LavaUI/Input.swift:220
case mouseDown
x/y = window position, button = which button, mods = held
modifier keys (see InputEvent.mods).
Sources/LavaUI/Input.swift:223
case mouseUp
A button was released. x/y = window position, button = which button.
Sources/LavaUI/Input.swift:225
case mouseMove
The pointer moved. x/y = window position.
Sources/LavaUI/Input.swift:227
case resize
Framebuffer size changed; x/y are new width/height.
Sources/LavaUI/Input.swift:229
case key
Keyboard; button = key, x = action, y = mods.
Sources/LavaUI/Input.swift:231
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:234
case scroll
Wheel / trackpad; x/y are deltas in notches, button holds mods.
Sources/LavaUI/Input.swift:236
case refresh
Window needs a redraw (expose, un-minimize, compositor damage).
Sources/LavaUI/Input.swift:238
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:242
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:254
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:264
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:273
case pointerLeave
The pointer left this window. No payload — see PointerLeave in
draw_command.hpp.
Sources/LavaUI/Input.swift:276
case windowState
The window was maximized or restored. button = 1 maximized, 0
restored. See WindowState in draw_command.hpp.
Sources/LavaUI/Input.swift:279
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:283
case dragLeave
The drag left this window, or ended anywhere. No payload.
Sources/LavaUI/Input.swift:285
case scale
The output scale this window is drawn at, in x: framebuffer pixels
per layout pixel. Layout stays in layout pixels either way. See
Scale in draw_command.hpp.
Sources/LavaUI/Input.swift:289