fix(gui): correct dispatching of mouse dragging events

This commit is contained in:
CJ van den Berg 2026-03-30 20:40:39 +02:00
parent 9b0f40f155
commit 0a9842f34d
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
3 changed files with 46 additions and 5 deletions

View file

@ -310,11 +310,11 @@ fn wioLoop() void {
const row_cell: i32 = @intCast(@divTrunc(@as(i32, @intCast(pos.y)), wio_font.cell_size.y));
const xoff: i32 = @intCast(@mod(@as(i32, @intCast(pos.x)), wio_font.cell_size.x));
const yoff: i32 = @intCast(@mod(@as(i32, @intCast(pos.y)), wio_font.cell_size.y));
tui_pid.send(.{
"RDR", "M",
col_cell, row_cell,
xoff, yoff,
}) catch {};
if (input_translate.heldMouseButtonId(held_buttons)) |mb_id| {
tui_pid.send(.{ "RDR", "D", mb_id, col_cell, row_cell, xoff, yoff }) catch {};
} else {
tui_pid.send(.{ "RDR", "M", col_cell, row_cell, xoff, yoff }) catch {};
}
},
.scroll_vertical => |dy| {
const btn_id: u8 = if (dy < 0) 64 else 65; // up / down scroll