summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog.adoc1
-rw-r--r--src/gui/gui-key.c4
-rw-r--r--tests/unit/gui/test-gui-key.cpp14
3 files changed, 17 insertions, 2 deletions
diff --git a/ChangeLog.adoc b/ChangeLog.adoc
index 7cd5ebf21..093811487 100644
--- a/ChangeLog.adoc
+++ b/ChangeLog.adoc
@@ -27,6 +27,7 @@ New features::
Bug fixes::
+ * core: remove incorrect warning when binding keys kbd:[F10] to kbd:[F20] (issue #2039)
* core: call hook config when options are removed
* core: display an error with command `/history N` when N is not a valid integer
* core: fix memory leak when config version is invalid or not supported
diff --git a/src/gui/gui-key.c b/src/gui/gui-key.c
index 6602e141c..90da58642 100644
--- a/src/gui/gui-key.c
+++ b/src/gui/gui-key.c
@@ -75,8 +75,8 @@ char *gui_key_modifier_list[] =
{ "meta-", "ctrl-", "shift-", NULL };
char *gui_key_alias_list[] =
-{ "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "f10", "f11",
- "f12", "f13", "f14", "f15", "f16", "f17", "f18", "f19", "f20",
+{ "f10", "f11", "f12", "f13", "f14", "f15", "f16", "f17", "f18", "f19", "f20",
+ "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9",
"home", "insert", "delete", "end", "backspace", "pgup", "pgdn",
"up", "down", "right", "left", "tab", "return", "comma", "space", NULL };
diff --git a/tests/unit/gui/test-gui-key.cpp b/tests/unit/gui/test-gui-key.cpp
index 76b3e1055..0ee2f76cf 100644
--- a/tests/unit/gui/test-gui-key.cpp
+++ b/tests/unit/gui/test-gui-key.cpp
@@ -1053,18 +1053,32 @@ TEST(GuiKey, SeemsValid)
LONGS_EQUAL(0, gui_key_seems_valid (GUI_KEY_CONTEXT_DEFAULT, "meta-cb"));
LONGS_EQUAL(0, gui_key_seems_valid (GUI_KEY_CONTEXT_DEFAULT, "meta-updown"));
LONGS_EQUAL(0, gui_key_seems_valid (GUI_KEY_CONTEXT_DEFAULT, "@chat:button1"));
+ LONGS_EQUAL(0, gui_key_seems_valid (GUI_KEY_CONTEXT_DEFAULT, "meta-test"));
+ LONGS_EQUAL(0, gui_key_seems_valid (GUI_KEY_CONTEXT_DEFAULT, "ctrl-test"));
+ LONGS_EQUAL(0, gui_key_seems_valid (GUI_KEY_CONTEXT_DEFAULT, "shift-test"));
/* valid keys */
LONGS_EQUAL(1, gui_key_seems_valid (GUI_KEY_CONTEXT_DEFAULT, "a"));
LONGS_EQUAL(1, gui_key_seems_valid (GUI_KEY_CONTEXT_DEFAULT, "A"));
LONGS_EQUAL(1, gui_key_seems_valid (GUI_KEY_CONTEXT_DEFAULT, "é"));
LONGS_EQUAL(1, gui_key_seems_valid (GUI_KEY_CONTEXT_DEFAULT, "/"));
+ LONGS_EQUAL(1, gui_key_seems_valid (GUI_KEY_CONTEXT_DEFAULT, "f1"));
+ LONGS_EQUAL(1, gui_key_seems_valid (GUI_KEY_CONTEXT_DEFAULT, "f10"));
+ LONGS_EQUAL(1, gui_key_seems_valid (GUI_KEY_CONTEXT_DEFAULT, "f11"));
+ LONGS_EQUAL(1, gui_key_seems_valid (GUI_KEY_CONTEXT_DEFAULT, "f2"));
+ LONGS_EQUAL(1, gui_key_seems_valid (GUI_KEY_CONTEXT_DEFAULT, "f20"));
LONGS_EQUAL(1, gui_key_seems_valid (GUI_KEY_CONTEXT_DEFAULT, "meta-a"));
LONGS_EQUAL(1, gui_key_seems_valid (GUI_KEY_CONTEXT_DEFAULT, "meta-ctrl-a"));
LONGS_EQUAL(1, gui_key_seems_valid (GUI_KEY_CONTEXT_DEFAULT, "meta-c,b"));
LONGS_EQUAL(1, gui_key_seems_valid (GUI_KEY_CONTEXT_DEFAULT, "meta-w,meta-up"));
LONGS_EQUAL(1, gui_key_seems_valid (GUI_KEY_CONTEXT_DEFAULT, "ctrl-left"));
LONGS_EQUAL(1, gui_key_seems_valid (GUI_KEY_CONTEXT_DEFAULT, "ctrl-u"));
+ LONGS_EQUAL(1, gui_key_seems_valid (GUI_KEY_CONTEXT_DEFAULT, "shift-home"));
+ LONGS_EQUAL(1, gui_key_seems_valid (GUI_KEY_CONTEXT_DEFAULT, "shift-f1"));
+ LONGS_EQUAL(1, gui_key_seems_valid (GUI_KEY_CONTEXT_DEFAULT, "shift-f10"));
+ LONGS_EQUAL(1, gui_key_seems_valid (GUI_KEY_CONTEXT_DEFAULT, "shift-f11"));
+ LONGS_EQUAL(1, gui_key_seems_valid (GUI_KEY_CONTEXT_DEFAULT, "shift-f2"));
+ LONGS_EQUAL(1, gui_key_seems_valid (GUI_KEY_CONTEXT_DEFAULT, "shift-f20"));
LONGS_EQUAL(1, gui_key_seems_valid (GUI_KEY_CONTEXT_CURSOR, "@chat:q"));
LONGS_EQUAL(1, gui_key_seems_valid (GUI_KEY_CONTEXT_MOUSE, "@chat:button1"));
}