mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-06 16:05:05 +02:00
cocoa: Unmark IME pre-edit text on Ctrl+H
This ensures that Ctrl+H behaves like Backspace and correctly clears the pre-edit state, preventing uncommitted characters from remaining on the screen when using IMEs like the Japanese one on macOS.
This commit is contained in:
@@ -1279,7 +1279,7 @@ is_ascii_control_char(char x) {
|
||||
const uint32_t key = translateKey(keycode, true);
|
||||
const bool process_text = !_glfw.ignoreOSKeyboardProcessing && (!window->ns.textInputFilterCallback || window->ns.textInputFilterCallback(key, mods, keycode, flags) != 1);
|
||||
_glfw.ns.text[0] = 0;
|
||||
if (keycode == 0x33 /* backspace */ || keycode == 0x35 /* escape */) [self unmarkText];
|
||||
if (keycode == 0x33 /* backspace */ || keycode == 0x35 /* escape */ || (keycode == 0x04 /* h */ && (mods & GLFW_MOD_CONTROL))) [self unmarkText];
|
||||
GLFWkeyevent glfw_keyevent = {.key = key, .native_key = keycode, .native_key_id = keycode, .action = GLFW_PRESS, .mods = mods};
|
||||
if (!_glfw.ns.unicodeData) {
|
||||
// Using the cocoa API for key handling is disabled, as there is no
|
||||
|
||||
Reference in New Issue
Block a user