From 9c2fc736b9ccd7b7eea11e7f544ed540d2d2a6c2 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 17 Nov 2026 00:25:48 -0300 Subject: Term: input through the interface: Term.key writes a key's bytes as its program's keyboard protocol and modes ask, Term.mouse and Term.wheel a mouse event's and a wheel turn's, Term.paste a paste as xterm makes one, Term.modes is the plain record of the modes the core decides by (mouse, all motion, the wheel, focus, bracketed paste, the alternate screen) and Term.promptMoves how far a click on the prompt line moves the shell's cursor; the mouse's records (MouseMods, MouseButton, MouseAction) are the interface's; keys.forwardKey (the bytes queued, an error reported) and keys.enterTty (raw mode, the cursor handed to the shell) are the core's, in keys.zig, pardes.keys for the tests; bracketedPaste, reportsMouse, reportsFocus, ownsWheel, tracksAllMotion and onAlternateScreen go into the record; the tests that called them follow; nothing else changes --- src/gui/gui.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gui') diff --git a/src/gui/gui.zig b/src/gui/gui.zig index dbae12b5..4b956f52 100644 --- a/src/gui/gui.zig +++ b/src/gui/gui.zig @@ -624,7 +624,7 @@ const Gui = struct { /// picture follows on a spring (Glide), never the other way round. scroll_notch: i32 = 0, /// A touchpad's fraction toward the next turn sent to a program that - /// owns the wheel (terminal.ownsWheel). + /// owns the wheel (Term.Modes.wheel). program_wheel: f32 = 0, /// A trackpad's horizontal fraction toward the next turn (wheelAt). program_wheel_x: f32 = 0, @@ -2443,7 +2443,7 @@ fn wheelAt(g: *Gui, in: *Input, w: WheelTurn, mc: MouseCell) void { // touchpad's fraction of a notch too (pa_mouse.amount). resetScroll(g); in.post(.{ .mouse = .{ .button = if (w.y < 0) .wheel_down else .wheel_up, .kind = .press, .col = mc.col, .row = mc.row, .tag_hit = mc.tag_hit, .body_hit = mc.body_hit, .ctrl = w.mods.ctrl, .shift = w.mods.shift, .alt = w.mods.alt, .amount = @abs(w.y) } }); - } else if (!w.mods.shift and pane.isTerminal() and pardes.panes.terminal.ownsWheel(pane)) { + } else if (!w.mods.shift and pane.isTerminal() and pardes.Term.modes(pane.terminal).wheel) { // The program's (codex, htop, less): every whole turn goes // to it, no glide, for nothing of ours moves. Shift keeps // a terminal's wheel pardes's. -- cgit v1.3