mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-09-21 12:17:14 +00:00
The ForwardKeyEvent ibus signal is used to maintain ordering between CommitText events and non-IME key events.
The ordering is important for Korean IMEs, where it automatically commits text whenever a character is fully composed. This is different from Chinese/Japanese IMEs, where user manually presses a key to commit each word.
Without this patch, kitty can't handle non-IME key events when used with ibus-hangul, which utilizes ForwardKeyEvent signal.
Without ForwardKeyEvent:
```
key | sequence of events from application's view
r | UpdatePreeditText 'ㄱ'
k | UpdatePreeditText '가'
1 | (receives the reply to ProcessKeyEvent call: "native_key: 0x31 release: 0 handled: 0")
| -> UpdatePreeditText ''
| -> CommitText '가'
```
Application receives "1가", which is incorrect.
With ForwardKeyEvent:
```
key | sequence of events from application's view
r | UpdatePreeditText 'ㄱ'
k | UpdatePreeditText '가'
1 | (receives the reply to ProcessKeyEvent call: "native_key: 0x31 release: 0 handled: 1", and kitty discards the event)
| -> UpdatePreeditText ''
| -> CommitText '가'
| -> ForwardKeyEvent keysym=0x31("1")
```
Application receives "가1", which is correct.
Relevant ibus-hangul github issue to implement ForwardKeyEvent: https://github.com/libhangul/ibus-hangul/issues/42
Relevant changes in Qt to handle ForwardKeyEvent: https://codereview.qt-project.org/c/qt/qtbase/+/212179, https://codereview.qt-project.org/c/qt/qtbase/+/255587
|
||
|---|---|---|
| .. | ||
| __init__.py | ||
| backend_utils.c | ||
| backend_utils.h | ||
| cocoa_init.m | ||
| cocoa_joystick.h | ||
| cocoa_joystick.m | ||
| cocoa_monitor.m | ||
| cocoa_platform.h | ||
| cocoa_window.m | ||
| context.c | ||
| dbus_glfw.c | ||
| dbus_glfw.h | ||
| egl_context.c | ||
| egl_context.h | ||
| glfw.py | ||
| glfw3.h | ||
| glx_context.c | ||
| glx_context.h | ||
| ibus_glfw.c | ||
| ibus_glfw.h | ||
| init.c | ||
| input.c | ||
| internal.h | ||
| linux_desktop_settings.c | ||
| linux_desktop_settings.h | ||
| linux_joystick.c | ||
| linux_joystick.h | ||
| linux_notify.c | ||
| linux_notify.h | ||
| main_loop.h | ||
| mappings.h | ||
| memfd.h | ||
| monitor.c | ||
| monotonic.c | ||
| nsgl_context.h | ||
| nsgl_context.m | ||
| null_init.c | ||
| null_joystick.c | ||
| null_joystick.h | ||
| null_monitor.c | ||
| null_platform.h | ||
| null_window.c | ||
| osmesa_context.c | ||
| osmesa_context.h | ||
| posix_thread.c | ||
| posix_thread.h | ||
| source-info.json | ||
| vulkan.c | ||
| window.c | ||
| wl_client_side_decorations.c | ||
| wl_client_side_decorations.h | ||
| wl_cursors.c | ||
| wl_cursors.h | ||
| wl_init.c | ||
| wl_monitor.c | ||
| wl_platform.h | ||
| wl_text_input.c | ||
| wl_text_input.h | ||
| wl_window.c | ||
| x11_init.c | ||
| x11_monitor.c | ||
| x11_platform.h | ||
| x11_window.c | ||
| xkb-compat-shim.h | ||
| xkb_glfw.c | ||
| xkb_glfw.h | ||