diff options
author | Georges Basile Stavracas Neto <georges.stavracas@gmail.com> | 2017-05-03 15:55:30 -0300 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2017-05-04 10:42:14 +0200 |
commit | f981eb58acfab088639cb32d0ed92ce75690abc3 (patch) | |
tree | e416bb4aa223c04c971e2108a71aa7ccadc6fc9a /panels | |
parent | 1cb787e8b8643efd6262fa3a31b4887fac5ee607 (diff) | |
download | gnome-control-center-f981eb58acfab088639cb32d0ed92ce75690abc3.tar.gz |
keyboard: Add more key aliases
To improve even more the search feature, add the
following new key aliases:
Option → Alt
Command → Super
Apple → Super
https://bugzilla.gnome.org/show_bug.cgi?id=772565
Diffstat (limited to 'panels')
-rw-r--r-- | panels/keyboard/cc-keyboard-panel.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/panels/keyboard/cc-keyboard-panel.c b/panels/keyboard/cc-keyboard-panel.c index 4487beae3..ad0f0e748 100644 --- a/panels/keyboard/cc-keyboard-panel.c +++ b/panels/keyboard/cc-keyboard-panel.c @@ -348,8 +348,11 @@ strv_contains_prefix_or_match (gchar **strv, const gchar *synonym; } key_aliases[] = { - { "ctrl", "Ctrl", "ctrl" }, - { "win", "Super", "super" }, + { "ctrl", "Ctrl", "ctrl" }, + { "win", "Super", "super" }, + { "option", NULL, "alt" }, + { "command", NULL, "super" }, + { "apple", NULL, "super" }, }; for (i = 0; strv[i]; i++) @@ -361,15 +364,20 @@ strv_contains_prefix_or_match (gchar **strv, for (i = 0; i < G_N_ELEMENTS (key_aliases); i++) { g_autofree gchar *alias = NULL; - const gchar *translated_label, *synonym; + const gchar *synonym; if (!g_str_has_prefix (key_aliases[i].key, prefix)) continue; - /* Get GTK+'s translation */ - translated_label = g_dpgettext2 ("gtk30", "keyboard label", key_aliases[i].untranslated); + if (key_aliases[i].untranslated) + { + const gchar *translated_label; + + /* Steal GTK+'s translation */ + translated_label = g_dpgettext2 ("gtk30", "keyboard label", key_aliases[i].untranslated); + alias = g_utf8_strdown (translated_label, -1); + } - alias = g_utf8_strdown (translated_label, -1); synonym = key_aliases[i].synonym; /* If a translation or synonym of the key is in the accelerator, and we typed |