UI module

send_mouse_move

procedureextensionexperimentalsince 0.31.0Source

Queue a pointer move to (x, y) in points.

Example↗
ui := headless(.{ width = 320, height = 200 });
defer free_ui(*ui);
count := 0;
build := (n: *int) {
    for column(.{ gap = 8, padding = 16 }) {
        label(tprint("Clicked % times", n.*));
        if button("Add") n.* += 1;
    }
};
frame(*ui, *count, build);
send_mouse_move(*ui, 20, 20);
frame(*ui, *count, build);
send_mouse_move :: (ui: *UI_State, x: float, y: float)

Queue a pointer move to (x, y) in points.

Parameters

ui: *UI_State
the UI to queue the event on.
x: float
the new horizontal position.
y: float
the new vertical position.
Example↗
ui := headless(.{ width = 320, height = 200 });
defer free_ui(*ui);
count := 0;
build := (n: *int) {
    for column(.{ gap = 8, padding = 16 }) {
        label(tprint("Clicked % times", n.*));
        if button("Add") n.* += 1;
    }
};
frame(*ui, *count, build);
send_mouse_move(*ui, 20, 20);
frame(*ui, *count, build);

See also