From 759ae94f15cdda8d13787f88f92153b00aa13c18 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 15 Aug 2023 22:38:54 -0700 Subject: [PATCH] macos: do not send ctrl or super into UCKeyTranslate see comment --- src/apprt/embedded.zig | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/apprt/embedded.zig b/src/apprt/embedded.zig index 2612022f5..83432a9dd 100644 --- a/src/apprt/embedded.zig +++ b/src/apprt/embedded.zig @@ -405,6 +405,17 @@ pub const Surface = struct { }, } + // On macOS we strip ctrl because UCKeyTranslate + // converts to the masked values (i.e. ctrl+c becomes 3) + // and we don't want that behavior. + // + // We also strip super because its not used for translation + // on macos and it results in a bad translation. + if (comptime builtin.target.isDarwin()) { + translate_mods.ctrl = false; + translate_mods.super = false; + } + break :translate_mods translate_mods; };