diff options
Diffstat (limited to 'gtk2_ardour/sync-menu.c')
-rw-r--r-- | gtk2_ardour/sync-menu.c | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/gtk2_ardour/sync-menu.c b/gtk2_ardour/sync-menu.c index 229802b324..60dff79e07 100644 --- a/gtk2_ardour/sync-menu.c +++ b/gtk2_ardour/sync-menu.c @@ -311,30 +311,45 @@ carbon_menu_item_update_accelerator (CarbonMenuItem *carbon_item, GdkKeymap *keymap = gdk_keymap_get_for_display (display); GdkKeymapKey *keys; gint n_keys; + gint use_command; if (gdk_keymap_get_entries_for_keyval (keymap, key->accel_key, &keys, &n_keys)) { - UInt8 modifiers = 0; + UInt8 modifiers = 0; /* implies Command key */ SetMenuItemCommandKey (carbon_item->menu, carbon_item->index, true, keys[0].keycode); g_free (keys); + use_command = 0; + if (key->accel_mods) { - if (key->accel_mods & GDK_SHIFT_MASK) + if (key->accel_mods & GDK_SHIFT_MASK) { modifiers |= kMenuShiftModifier; + } - if (key->accel_mods & GDK_MOD1_MASK) + if (key->accel_mods & (GDK_MOD1_MASK)) { modifiers |= kMenuOptionModifier; - } - - if (!(key->accel_mods & GDK_CONTROL_MASK)) - { - modifiers |= kMenuNoCommandModifier; - } + } + + if (key->accel_mods & GDK_CONTROL_MASK) { + modifiers |= kMenuControlModifier; + } + + if (key->accel_mods & GDK_MOD5_MASK) { + /* Mod5 is what ardour's binding file uses to mean "Command" + Nothing needs to be set in modifiers, but we need to notice + that there *is* an implicit modifier + */ + use_command = 1; + } + } + + if (!use_command) + modifiers |= kMenuNoCommandModifier; SetMenuItemModifiers (carbon_item->menu, carbon_item->index, modifiers); |