From bc7643eae973b7e9da1a92ad4f08257df84ec6ec Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 29 Nov 2023 21:35:47 -0800 Subject: [PATCH] input: update preventsText comment --- src/input/KeyEncoder.zig | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/input/KeyEncoder.zig b/src/input/KeyEncoder.zig index d4b6a5cad..887e522fc 100644 --- a/src/input/KeyEncoder.zig +++ b/src/input/KeyEncoder.zig @@ -607,17 +607,16 @@ const KittyMods = packed struct(u8) { }; } - /// Returns true if the modifiers prevent printable text + /// Returns true if the modifiers prevent printable text. + /// + /// Note on macOS: this logic alone is not enough, since you must + /// consider macos_option_as_alt. See the Kitty encoder for more details. pub fn preventsText(self: KittyMods) bool { - if (self.alt or + return self.alt or self.ctrl or self.super or self.hyper or - self.meta) - { - return true; - } - return false; + self.meta; } /// Returns the raw int value of this packed struct.