a modern tui library written in zig

Various fixes for WindowsTty

authored by Justin Braben and committed by rockorager.dev 9fc9015d 6eb16bb4

Changed files
+3 -4
src
+3 -4
src/tty.zig
··· 198 198 buf: [4]u8 = undefined, 199 199 200 200 /// File.Writer for efficient buffered writing 201 - reader: std.fs.File.Writer, 202 201 tty_writer: std.fs.File.Writer, 203 202 204 203 /// The last mouse button that was pressed. We store the previous state of button presses on each ··· 223 222 }; 224 223 225 224 pub fn init(buffer: []u8) !Tty { 226 - const stdin: std.fs.File = .stdout(); 225 + const stdin: std.fs.File = .stdin(); 227 226 const stdout: std.fs.File = .stdout(); 228 227 229 228 // get initial modes ··· 243 242 .initial_codepage = initial_output_codepage, 244 243 .initial_input_mode = initial_input_mode, 245 244 .initial_output_mode = initial_output_mode, 246 - .writer = .initStreaming(stdout, buffer), 245 + .tty_writer = .initStreaming(stdout, buffer), 247 246 }; 248 247 249 248 // save a copy of this tty as the global_tty for panic handling ··· 688 687 }; 689 688 pub const PINPUT_RECORD = *INPUT_RECORD; 690 689 691 - pub extern "kernel32" fn ReadConsoleInputW(hConsoleInput: windows.HANDLE, lpBuffer: PINPUT_RECORD, nLength: windows.DWORD, lpNumberOfEventsRead: *windows.DWORD) callconv(windows.WINAPI) windows.BOOL; 690 + pub extern "kernel32" fn ReadConsoleInputW(hConsoleInput: windows.HANDLE, lpBuffer: PINPUT_RECORD, nLength: windows.DWORD, lpNumberOfEventsRead: *windows.DWORD) callconv(.winapi) windows.BOOL; 692 691 }; 693 692 694 693 pub const TestTty = struct {