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
This commit is contained in:
parent
1cb787e8b8
commit
f981eb58ac
1 changed files with 14 additions and 6 deletions
|
@ -350,6 +350,9 @@ strv_contains_prefix_or_match (gchar **strv,
|
|||
{
|
||||
{ "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);
|
||||
}
|
||||
|
||||
synonym = key_aliases[i].synonym;
|
||||
|
||||
/* If a translation or synonym of the key is in the accelerator, and we typed
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue