summaryrefslogtreecommitdiff
path: root/gtk2_ardour/sync-menu.c
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2008-02-06 01:46:53 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2008-02-06 01:46:53 +0000
commit359e69ab882975da1b95f21e5ba876461aceea40 (patch)
tree918b532519e0280189527da0c3c2d9635e7c7649 /gtk2_ardour/sync-menu.c
parentc2ac101a10a2f87b1d01f3906ed7ef76214a7fa6 (diff)
get arrow keys to appear in the mac menu; add/change high level command to osx_build script; update ardour-sae.menus
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3014 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/sync-menu.c')
-rw-r--r--gtk2_ardour/sync-menu.c46
1 files changed, 40 insertions, 6 deletions
diff --git a/gtk2_ardour/sync-menu.c b/gtk2_ardour/sync-menu.c
index 22beca9b11..ec2b741d5a 100644
--- a/gtk2_ardour/sync-menu.c
+++ b/gtk2_ardour/sync-menu.c
@@ -312,16 +312,50 @@ carbon_menu_item_update_accelerator (CarbonMenuItem *carbon_item,
GdkKeymapKey *keys;
gint n_keys;
gint use_command;
+ gboolean add_modifiers = FALSE;
if (gdk_keymap_get_entries_for_keyval (keymap, key->accel_key,
- &keys, &n_keys))
- {
- UInt8 modifiers = 0; /* implies Command key */
+ &keys, &n_keys) == 0)
+ {
+ gint realkey = -1;
+
+ switch (key->accel_key) {
+ case GDK_rightarrow:
+ case GDK_Right:
+ realkey = kRightArrowCharCode;
+ break;
+ case GDK_leftarrow:
+ case GDK_Left:
+ realkey = kLeftArrowCharCode;
+ break;
+ case GDK_uparrow:
+ case GDK_Up:
+ realkey = kUpArrowCharCode;
+ break;
+ case GDK_downarrow:
+ case GDK_Down:
+ realkey = kDownArrowCharCode;
+ break;
+ default:
+ break;
+ }
+
+ if (realkey != -1) {
+ SetMenuItemCommandKey (carbon_item->menu, carbon_item->index,
+ false, realkey);
+ add_modifiers = TRUE;
+ }
- SetMenuItemCommandKey (carbon_item->menu, carbon_item->index,
- true, keys[0].keycode);
+ } else {
+ SetMenuItemCommandKey (carbon_item->menu, carbon_item->index,
+ true, keys[0].keycode);
+ g_free (keys);
+ add_modifiers = TRUE;
+ }
- g_free (keys);
+ if (add_modifiers)
+ {
+ UInt8 modifiers = 0; /* implies Command key */
use_command = 0;