From 3ea6e7e59ed65960882b93a975a7a1dcd6d4a064 Mon Sep 17 00:00:00 2001 From: Elaine Gibson Date: Sat, 6 Jun 2026 21:13:52 +0100 Subject: [PATCH] fix(gui): always process text input from char events --- src/gui/wio/app.zig | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/gui/wio/app.zig b/src/gui/wio/app.zig index 9db4e62b..28a88396 100644 --- a/src/gui/wio/app.zig +++ b/src/gui/wio/app.zig @@ -752,6 +752,14 @@ fn wioLoop() void { }) catch {}; } else { if (input_translate.codepointFromButton(btn, .{})) |base_cp| { + // Character keys are handled by .char unless modifiers are held. + if (std.math.cast(u8, base_cp)) |ascii| { + if (std.ascii.isPrint(ascii)) { + if (!mods.alt and !mods.ctrl) { + continue; + } + } + } const shifted_cp = if (mods.shift) input_translate.codepointFromButton(btn, .{ .shift = true }) else base_cp; sendKey(press, base_cp, shifted_cp orelse base_cp, mods); } else { @@ -793,13 +801,8 @@ fn wioLoop() void { } }, .char => |cp| { - // Only handle non-ASCII IME-composed codepoints here. - // ASCII keys are fully handled by .button_press with correct - // base/shifted codepoints, avoiding double-firing on X11. - if (cp > 0x7f) { - const mods = syncModifiers(); - sendKey(press, cp, cp, mods); - } + const mods = syncModifiers(); + sendKey(press, cp, cp, mods); }, .mouse => |pos| { mouse_pos = pos;