input: do not emit sequence on <BS> when their's UTF-8 text

This commit is contained in:
rok
2024-04-05 19:55:17 +09:00
parent 8e0faaf6c5
commit 51bfde69ba

View File

@ -245,6 +245,10 @@ fn legacy(
// If we're in a dead key state then we never emit a sequence. // If we're in a dead key state then we never emit a sequence.
if (self.event.composing) return ""; 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 we match a PC style function key then that is our result.
if (pcStyleFunctionKey( if (pcStyleFunctionKey(
self.event.key, self.event.key,