From 7ea8feea698cd13b7849e741f8a2d606904ad1b2 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 10 Aug 2023 22:03:20 -0700 Subject: [PATCH] apprt/embedded: fix char callback ignore when key is consumed --- src/apprt/embedded.zig | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/apprt/embedded.zig b/src/apprt/embedded.zig index e2e315605..47b4f52b3 100644 --- a/src/apprt/embedded.zig +++ b/src/apprt/embedded.zig @@ -441,6 +441,15 @@ pub const Surface = struct { // If we consume the key then we want to reset the dead key state. if (consumed) { self.keymap_state = .{}; + + // This is kloodge right now to reset the surface ignore_char + // state. We should refactor the API contract with the surface + // to be that if we consume a key then we don't call the char + // callback. + // + // If you don't do this, then after a consumed char a pure + // char event will be ignored. i.e. an emoji keyboard entry. + self.core_surface.charCallback(0) catch {}; return; } } @@ -452,7 +461,6 @@ pub const Surface = struct { // we can show the user that we're in dead key mode and the // precomposed character. For now, we can just ignore and that // is not incorrect behavior. - log.warn("dead key mode, currently composing", .{}); return; }