diff options
| author | Gabriel Schneider <[email protected]> | 2026-10-01 12:44:06 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 12:58:23 -0300 |
| commit | 8eeab5df9c09caafc07c93c2fc3baf6e6700afed (patch) | |
| tree | a35f70177414e360010f36abb62cb05eabd285d5 /src/gui | |
| parent | a99edf403dbcebae2ce557e2ba39078ffe876a92 (diff) | |
| download | pardes-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/gui')
| -rw-r--r-- | src/gui/gui.zig | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/gui.zig b/src/gui/gui.zig index e8dc99b9..65b3f926 100644 --- a/src/gui/gui.zig +++ b/src/gui/gui.zig @@ -4020,7 +4020,7 @@ fn wheelAt(g: *Gui, in: *Input, w: WheelTurn, mc: MouseCell) void { const WheelTurn = struct { x: f32 = 0, y: f32 = 0, integer_y: i32 = 0, mods: PointerMods = .{} }; /// The modifiers held with a pointer event, as the core's Mouse carries them. -const PointerMods = struct { ctrl: bool = false, shift: bool = false, alt: bool = false }; +const PointerMods = struct { ctrl: bool = false, shift: bool = false, alt: bool = false, super: bool = false }; /// The core's Mouse for an SDL press, release or move over cell `mc`. fn pointerMouse(button: pardes.Mouse.Button, kind: pardes.Mouse.Kind, mc: MouseCell, mods: PointerMods) pardes.Mouse { @@ -4035,12 +4035,13 @@ fn pointerMouse(button: pardes.Mouse.Button, kind: pardes.Mouse.Kind, mc: MouseC .ctrl = mods.ctrl, .shift = mods.shift, .alt = mods.alt, + .super = mods.super, }; } fn pointerMods() PointerMods { const m = c.SDL_GetModState(); - return .{ .ctrl = (m & c.SDL_KMOD_CTRL) != 0, .shift = (m & c.SDL_KMOD_SHIFT) != 0, .alt = (m & c.SDL_KMOD_ALT) != 0 }; + return .{ .ctrl = (m & c.SDL_KMOD_CTRL) != 0, .shift = (m & c.SDL_KMOD_SHIFT) != 0, .alt = (m & c.SDL_KMOD_ALT) != 0, .super = (m & c.SDL_KMOD_GUI) != 0 }; } fn mouseCellWithGeometry(g: *const Gui, core: ?*const pardes.Pardes, x: f32, y: f32, geometry: WindowGeometry) ?MouseCell { |
