From 8f4ca5b830ac4fd33a5d4604b2c0e910c067a194 Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Wed, 12 Jun 2024 11:15:16 -0500 Subject: [PATCH] tty(windows): enable_extended_flags Note: we still need to parse the events. --- src/windows/Tty.zig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/windows/Tty.zig b/src/windows/Tty.zig index 9c956d2..b0ca316 100644 --- a/src/windows/Tty.zig +++ b/src/windows/Tty.zig @@ -24,9 +24,10 @@ const utf8_codepage: c_uint = 65001; const InputMode = struct { const enable_window_input: u32 = 0x0008; // resize events const enable_mouse_input: u32 = 0x0010; + const enable_extended_flags: u32 = 0x0080; // allows mouse events pub fn rawMode() u32 { - return enable_window_input | enable_mouse_input; + return enable_window_input | enable_mouse_input | enable_extended_flags; } }; @@ -277,7 +278,7 @@ pub fn nextEvent(self: *Tty) !Event { else => return .{ .key_press = key }, } }, - 0x0002 => { // TODO: ConPTY doesn't pass through MOUSE_EVENT input records yet. + 0x0002 => { // TODO: Parse mouse events // see https://learn.microsoft.com/en-us/windows/console/mouse-event-record-str }, 0x0004 => { // Screen resize events