diff options
| author | Gabriel Schneider <[email protected]> | 2026-10-01 17:52:24 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 18:02:10 -0300 |
| commit | afec162464d360cbbf475d3fb7457cda83ce918f (patch) | |
| tree | 7278bc32743769c096fd743758ea3a2967b8be93 /src/tty/tty.zig | |
| parent | fe9ec319e01052e3ede65ad0e8a809dd5f2c9953 (diff) | |
| download | pardes-afec162464d360cbbf475d3fb7457cda83ce918f.tar.gz pardes-afec162464d360cbbf475d3fb7457cda83ce918f.zip | |
Back and Forward keep to the focused file: Ctrl-o, Ctrl-i, the mouse's side buttons (now the tty's 8 and 9 too), the builtins and 9P go to the nearest place that way in this pane, else in this file in another pane, else of any file; JumpScope all takes every place in order as before
Diffstat (limited to 'src/tty/tty.zig')
| -rw-r--r-- | src/tty/tty.zig | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/tty/tty.zig b/src/tty/tty.zig index a067ffce..f0f41747 100644 --- a/src/tty/tty.zig +++ b/src/tty/tty.zig @@ -2452,6 +2452,9 @@ fn mouseEvent(m: vaxis.Mouse) ?pardes.Event { .wheel_down => .wheel_down, .wheel_left => .wheel_left, .wheel_right => .wheel_right, + // A mouse's side buttons, as xterm reports them: Back and Forward. + .button_8 => .back, + .button_9 => .forward, .none => .none, // button-less motion: hover tracking else => return null, }; @@ -2471,6 +2474,13 @@ fn mouseEvent(m: vaxis.Mouse) ?pardes.Event { } }; } +test "a mouse's side buttons, xterm's 8 and 9, are Back and Forward, as SDL's X1 and X2 are" { + for ([_]vaxis.Mouse.Button{ .button_8, .button_9 }, [_]pardes.Mouse.Button{ .back, .forward }) |from, to| { + const event = mouseEvent(.{ .col = 3, .row = 2, .button = from, .mods = .{}, .type = .press }).?; + try std.testing.expectEqual(to, event.mouse.button); + } +} + /// A blank whose ink alone changed is not sent: vaxis's render skips it /// (pardes's patch to Vaxis.zig in build.zig), since a blank's ink shows /// nowhere. Deciding that here cost every cell of every frame a look at the |
