summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
Diffstat (limited to 'build')
-rw-r--r--build/patches.zig12
1 files changed, 12 insertions, 0 deletions
diff --git a/build/patches.zig b/build/patches.zig
index 410d27ab..1cf79ac1 100644
--- a/build/patches.zig
+++ b/build/patches.zig
@@ -123,6 +123,18 @@ const vaxis_parser = [_]Edit{
\\
,
},
+ // An X10 report's bytes are 32 and up, and a button is one Mouse has:
+ // what is not (a legacy terminal's `ESC [ M` then a control byte: Alt+[,
+ // Shift+M, Enter; `CSI < 192;1;1M`) is no event, never a u8 underflow
+ // or a cast (docs/vaxis-mouse-bytes.md).
+ .{
+ .old = " button_mask = full_input[3] - 32;\n",
+ .new = " if (full_input[3] < 32 or full_input[4] < 32 or full_input[5] < 32) return .{ .event = null, .n = 6 }; // pardes's patch (its build.zig)\n button_mask = full_input[3] - 32;\n",
+ },
+ .{
+ .old = " const button: Mouse.Button = @fromBackingInt(@intCast(button_mask & mouse_bits.buttons));\n",
+ .new = " const button = std.enums.fromInt(Mouse.Button, button_mask & mouse_bits.buttons) orelse return .{ .event = null, .n = if (xterm) 6 else input.len }; // pardes's patch (its build.zig)\n",
+ },
};
/// vaxis's render: a blank whose ink alone changed is not sent, since a