summaryrefslogtreecommitdiff
path: root/gtk/gtkaccellabel.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2005-09-06 18:13:56 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2005-09-06 18:13:56 +0000
commit244d41b94a045633281e47d720311e907d83aedb (patch)
tree5c6b4e81e0e960dc7fb4d7f167a8c86e33059ea5 /gtk/gtkaccellabel.c
parent543ce67477599e8b519a66fec1fc34d2e7157066 (diff)
downloadgtk+-244d41b94a045633281e47d720311e907d83aedb.tar.gz
Add tests for extra virtual modifiers.
2005-09-06 Matthias Clasen <mclasen@redhat.com> * tests/testgtk.c (create_key_lookup): Add tests for extra virtual modifiers. * gtk/gtkkeyhash.c (_gtk_key_hash_lookup): Try to match both against Mod2 - Mod5 and against Super, Hyper, Meta. * gtk/gtkaccellabel.c (_gtk_accel_label_class_get_accelerator_label): * gtk/gtkaccelgroup.c (gtk_accelerator_parse) (gtk_accelerator_name): Support Super, Hyper Meta and Mod2 - Mod5.
Diffstat (limited to 'gtk/gtkaccellabel.c')
-rw-r--r--gtk/gtkaccellabel.c76
1 files changed, 75 insertions, 1 deletions
diff --git a/gtk/gtkaccellabel.c b/gtk/gtkaccellabel.c
index fd159c34ba..fcfb80c975 100644
--- a/gtk/gtkaccellabel.c
+++ b/gtk/gtkaccellabel.c
@@ -556,13 +556,87 @@ _gtk_accel_label_class_get_accelerator_label (GtkAccelLabelClass *klass,
g_string_append (gstring, klass->mod_name_control);
seen_mod = TRUE;
}
- if (accelerator_mods & GDK_MOD1_MASK)
+ if (accelerator_mods & GDK_ALT_MASK)
{
if (seen_mod)
g_string_append (gstring, klass->mod_separator);
g_string_append (gstring, klass->mod_name_alt);
seen_mod = TRUE;
}
+ if (accelerator_mods & GDK_MOD2_MASK)
+ {
+ if (seen_mod)
+ g_string_append (gstring, klass->mod_separator);
+
+ g_string_append (gstring, "Mod2");
+ seen_mod = TRUE;
+ }
+ if (accelerator_mods & GDK_MOD3_MASK)
+ {
+ if (seen_mod)
+ g_string_append (gstring, klass->mod_separator);
+
+ g_string_append (gstring, "Mod3");
+ seen_mod = TRUE;
+ }
+ if (accelerator_mods & GDK_MOD4_MASK)
+ {
+ if (seen_mod)
+ g_string_append (gstring, klass->mod_separator);
+
+ g_string_append (gstring, "Mod4");
+ seen_mod = TRUE;
+ }
+ if (accelerator_mods & GDK_MOD5_MASK)
+ {
+ if (seen_mod)
+ g_string_append (gstring, klass->mod_separator);
+
+ g_string_append (gstring, "Mod5");
+ seen_mod = TRUE;
+ }
+ if (accelerator_mods & GDK_SUPER_MASK)
+ {
+ if (seen_mod)
+ g_string_append (gstring, klass->mod_separator);
+
+ /* This is the text that should appear next to menu accelerators
+ * that use the super key. If the text on this key isn't typically
+ * translated on keyboards used for your language, don't translate
+ * this.
+ * And do not translate the part before the |.
+ */
+ g_string_append (gstring, Q_("keyboard label|Super"));
+ seen_mod = TRUE;
+ }
+ if (accelerator_mods & GDK_HYPER_MASK)
+ {
+ if (seen_mod)
+ g_string_append (gstring, klass->mod_separator);
+
+ /* This is the text that should appear next to menu accelerators
+ * that use the hyper key. If the text on this key isn't typically
+ * translated on keyboards used for your language, don't translate
+ * this.
+ * And do not translate the part before the |.
+ */
+ g_string_append (gstring, Q_("keyboard label|Hyper"));
+ seen_mod = TRUE;
+ }
+ if (accelerator_mods & GDK_META_MASK)
+ {
+ if (seen_mod)
+ g_string_append (gstring, klass->mod_separator);
+
+ /* This is the text that should appear next to menu accelerators
+ * that use the meta key. If the text on this key isn't typically
+ * translated on keyboards used for your language, don't translate
+ * this.
+ * And do not translate the part before the |.
+ */
+ g_string_append (gstring, Q_("keyboard label|Meta"));
+ seen_mod = TRUE;
+ }
if (seen_mod)
g_string_append (gstring, klass->mod_separator);