From 8eeab5df9c09caafc07c93c2fc3baf6e6700afed Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 1 Oct 2026 12:44:06 -0300 Subject: Alt/Option-click is B2 and Super/Cmd-click is B3, sweeps included, as in plan9port: a one-button trackpad can execute and look The core decides it at the press (mouse.emulateButton) and keeps it to the release, whatever keys are let go between. Ctrl-click stays a definition, and a program tracking the mouse still gets the plain click (Alt as its meta, Super as nothing). The SDL, macOS and web shells now pass Super; the macOS and web shells pass Alt on a click too. A terminal's mouse report has no Super bit, so in a terminal only Alt-click is B2. Co-Authored-By: Claude Opus 5.5 --- src/pardes.zig | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/pardes.zig') diff --git a/src/pardes.zig b/src/pardes.zig index 41ed0e5a..38373266 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -3515,6 +3515,9 @@ pub const Mouse = struct { shift: bool = false, /// Alt, which xterm's mouse reports call meta. alt: bool = false, + /// Super: Cmd on a Mac, the Windows key elsewhere. A terminal's mouse + /// report has no such bit, so only a pixel shell sets it. + super: bool = false, body_hit: ?BodyHit = null, tag_hit: ?TagHit = null, /// A pixel frontend's press on the rule it draws at the top of this row, @@ -4414,6 +4417,9 @@ pub const Pardes = struct { /// The last plain B1 click, for acme's double-click (text.c:881, /// textselect: a second click at the same point within 500 ms). last_click: ?struct { id: usize, on_tag: bool, row: i32, col: i32, ms: i64 } = null, + /// The button an Alt- or Super-click of button 1 stands for, from its + /// press through its release (mouse.emulateButton). + click_as: ?Mouse.Button = null, /// A B1 chord's edits share the undo point it took (mouse.zig). chord_hold: bool = false, /// The look just run found nothing (look.zig missed). -- cgit v1.3