mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-11 19:19:35 +02:00
Special case the IME injecting text in on_key_input
This commit is contained in:
@@ -152,6 +152,12 @@ on_key_input(GLFWkeyevent *ev) {
|
||||
debug("invalid state, ignoring\n");
|
||||
return;
|
||||
}
|
||||
if (!native_key && !key && text[0]) {
|
||||
// key == 0 is sent by the glfw coca backend when text is inserted by the IME outside the key handlers
|
||||
schedule_write_to_child(w->id, 1, text, strlen(text));
|
||||
debug("sent key as text to child\n");
|
||||
return;
|
||||
}
|
||||
PyObject *ke = NULL;
|
||||
#define create_key_event() { ke = convert_glfw_key_event_to_python(ev); if (!ke) { PyErr_Print(); return; } }
|
||||
if (global_state.in_sequence_mode) {
|
||||
@@ -187,8 +193,7 @@ on_key_input(GLFWkeyevent *ev) {
|
||||
}
|
||||
}
|
||||
if (!w) return;
|
||||
} else if (w->last_special_key_pressed == key && key != 0) {
|
||||
// key == 0 is sent by the glfw coca backend when text is inserted by the IME outside the key handlers
|
||||
} else if (w->last_special_key_pressed == key) {
|
||||
w->last_special_key_pressed = 0;
|
||||
debug("ignoring release event for previous press that was handled as shortcut\n");
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user