diff options
-rw-r--r-- | src/gui/gui-key.c | 8 | ||||
-rw-r--r-- | tests/unit/gui/test-gui-key.cpp | 5 |
2 files changed, 5 insertions, 8 deletions
diff --git a/src/gui/gui-key.c b/src/gui/gui-key.c index 7f7efc143..ba52e805c 100644 --- a/src/gui/gui-key.c +++ b/src/gui/gui-key.c @@ -449,13 +449,7 @@ gui_key_expand (const char *key, char **key_name, char **key_name_alias) key += 2; } - if (string_strncmp (key, "\x01[[O", 4) == 0) - { - snprintf (str_raw, sizeof (str_raw), "meta-[O"); - meta2 = 1; - key += 4; - } - else if (string_strncmp (key, "\x01[O", 3) == 0) + if (string_strncmp (key, "\x01[O", 3) == 0) { snprintf (str_raw, sizeof (str_raw), "meta-O"); meta2 = 1; diff --git a/tests/unit/gui/test-gui-key.cpp b/tests/unit/gui/test-gui-key.cpp index 2a63fe37f..b69780619 100644 --- a/tests/unit/gui/test-gui-key.cpp +++ b/tests/unit/gui/test-gui-key.cpp @@ -198,7 +198,6 @@ TEST(GuiKey, Expand) WEE_CHECK_EXP_KEY(0, NULL, NULL, "\001["); WEE_CHECK_EXP_KEY(0, NULL, NULL, "\001[O"); WEE_CHECK_EXP_KEY(0, NULL, NULL, "\001[["); - WEE_CHECK_EXP_KEY(0, NULL, NULL, "\001[[O"); WEE_CHECK_EXP_KEY(0, NULL, NULL, "\001[[1"); WEE_CHECK_EXP_KEY(0, NULL, NULL, "\001[[12"); WEE_CHECK_EXP_KEY(0, NULL, NULL, "\001[[123"); @@ -209,6 +208,10 @@ TEST(GuiKey, Expand) WEE_CHECK_EXP_KEY(0, NULL, NULL, "\001[[15;1"); WEE_CHECK_EXP_KEY(0, NULL, NULL, "\001[[["); + /* focus/unfocus terminal (xterm) */ + WEE_CHECK_EXP_KEY(1, "meta-[I", "meta-[I", "\001[[I"); + WEE_CHECK_EXP_KEY(1, "meta-[O", "meta-[O", "\001[[O"); + /* unknown sequence: kept as-is */ WEE_CHECK_EXP_KEY(1, "meta-[x", "meta-[x", "\001[[x"); WEE_CHECK_EXP_KEY(1, "meta-[é", "meta-[é", "\001[[é"); |