summaryrefslogtreecommitdiff
path: root/src/input/KeyEncoder.zig
diff options
context:
space:
mode:
authorrok <kyungrok.chung@tossinvest.com>2024-04-05 19:55:17 +0900
committerrok <kyungrok.chung@tossinvest.com>2024-04-05 19:55:17 +0900
commit51bfde69ba35cae91ee7ddf286f6cf0d419f1bac (patch)
tree66e5e758eaa851571640af47f3e7b4547d331ed5 /src/input/KeyEncoder.zig
parent8e0faaf6c5333f295d0ba8b59f1e6abc25cfebe2 (diff)
input: do not emit sequence on <BS> when their's UTF-8 text
Diffstat (limited to 'src/input/KeyEncoder.zig')
-rw-r--r--src/input/KeyEncoder.zig4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/input/KeyEncoder.zig b/src/input/KeyEncoder.zig
index 26eea2907..0eb875b28 100644
--- a/src/input/KeyEncoder.zig
+++ b/src/input/KeyEncoder.zig
@@ -245,6 +245,10 @@ fn legacy(
// If we're in a dead key state then we never emit a sequence.
if (self.event.composing) return "";
+ // When pressed backspace and have UTF-8 text, do not emit sequence.
+ // This prevents backspace emitted twice on macOS with korean input method.
+ if (self.event.key == .backspace and self.event.utf8.len > 0) return "";
+
// If we match a PC style function key then that is our result.
if (pcStyleFunctionKey(
self.event.key,