mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-06 01:05:48 +02:00
Keyboard events: Fix turning on only the "Report all keys as escape codes" enhancement not reporting modifier+enter/tab/backspace using escape codes
This commit is contained in:
@@ -150,7 +150,7 @@ encode_function_key(const KeyEvent *ev, char *output) {
|
||||
#define SIMPLE(val) return snprintf(output, KEY_BUFFER_SIZE, "%s", val);
|
||||
char csi_trailer = 'u';
|
||||
uint32_t key_number = ev->key;
|
||||
bool legacy_mode = !ev->report_all_event_types && !ev->disambiguate;
|
||||
bool legacy_mode = !ev->report_all_event_types && !ev->disambiguate && !ev->report_text;
|
||||
|
||||
if (ev->cursor_key_mode && legacy_mode && !ev->mods.value) {
|
||||
switch(key_number) {
|
||||
@@ -435,7 +435,7 @@ encode_glfw_key_event(const GLFWkeyevent *e, const bool cursor_key_mode, const u
|
||||
ev.has_text = e->text && !startswith_ascii_control_char(e->text);
|
||||
if (!ev.key && !ev.has_text) return 0;
|
||||
bool send_text_standalone = !ev.report_text;
|
||||
if (!ev.disambiguate && GLFW_FKEY_KP_0 <= ev.key && ev.key <= GLFW_FKEY_KP_BEGIN) {
|
||||
if (!ev.disambiguate && !ev.report_text && GLFW_FKEY_KP_0 <= ev.key && ev.key <= GLFW_FKEY_KP_BEGIN) {
|
||||
ev.key = convert_kp_key_to_normal_key(ev.key);
|
||||
}
|
||||
switch (e->action) {
|
||||
|
||||
@@ -461,6 +461,7 @@ class TestKeys(BaseTest):
|
||||
ae(kq(defines.GLFW_FKEY_UP), '\x1b[A')
|
||||
ae(kq(defines.GLFW_FKEY_LEFT_SHIFT), csi(num=defines.GLFW_FKEY_LEFT_SHIFT))
|
||||
ae(kq(defines.GLFW_FKEY_ENTER), '\x1b[13u')
|
||||
ae(kq(defines.GLFW_FKEY_ENTER, mods=ctrl), '\x1b[13;5u')
|
||||
ae(kq(defines.GLFW_FKEY_TAB), '\x1b[9u')
|
||||
ae(kq(defines.GLFW_FKEY_BACKSPACE), '\x1b[127u')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user