summaryrefslogtreecommitdiff
path: root/src/pardes.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-01 12:44:06 -0300
committerGabriel Schneider <[email protected]>2026-10-01 12:58:23 -0300
commit8eeab5df9c09caafc07c93c2fc3baf6e6700afed (patch)
treea35f70177414e360010f36abb62cb05eabd285d5 /src/pardes.zig
parenta99edf403dbcebae2ce557e2ba39078ffe876a92 (diff)
downloadpardes-8eeab5df9c09caafc07c93c2fc3baf6e6700afed.tar.gz
pardes-8eeab5df9c09caafc07c93c2fc3baf6e6700afed.zip
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 <[email protected]>
Diffstat (limited to 'src/pardes.zig')
-rw-r--r--src/pardes.zig6
1 files changed, 6 insertions, 0 deletions
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).