mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-20 15:35:03 +02:00
Fix handling of alt (option) key on macOS
It now works just as in linux. i.e. alt+a sends <esc>a to the client. No longer needs turning off alt to generate unicode at the OS level.
This commit is contained in:
10
kitty/keys.c
10
kitty/keys.c
@@ -51,16 +51,8 @@ on_text_input(unsigned int codepoint, int mods) {
|
||||
unsigned int sz = 0;
|
||||
|
||||
if (w != NULL) {
|
||||
Screen *screen = w->render_data.screen;
|
||||
bool in_alt_mods = !screen->modes.mEXTENDED_KEYBOARD && (mods == GLFW_MOD_ALT || mods == (GLFW_MOD_ALT | GLFW_MOD_SHIFT));
|
||||
bool is_text = mods <= GLFW_MOD_SHIFT;
|
||||
if (in_alt_mods) {
|
||||
sz = encode_utf8(codepoint, buf + 1);
|
||||
if (sz) {
|
||||
buf[0] = 033;
|
||||
sz++;
|
||||
}
|
||||
} else if (is_text) sz = encode_utf8(codepoint, buf);
|
||||
if (is_text) sz = encode_utf8(codepoint, buf);
|
||||
if (sz) schedule_write_to_child(w->id, buf, sz);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user