summaryrefslogtreecommitdiff
path: root/gtk2_ardour/pianokeyboard.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gtk2_ardour/pianokeyboard.cc')
-rw-r--r--gtk2_ardour/pianokeyboard.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/gtk2_ardour/pianokeyboard.cc b/gtk2_ardour/pianokeyboard.cc
index baf31c3005..6aef86ee26 100644
--- a/gtk2_ardour/pianokeyboard.cc
+++ b/gtk2_ardour/pianokeyboard.cc
@@ -536,15 +536,23 @@ APianoKeyboard::bind_keys_basic_qwertz ()
static char*
get_keycode (GdkEventKey* event)
{
- GdkKeymapKey kk;
-
/* We're not using event->keyval, because we need keyval with level set to 0.
E.g. if user holds Shift and presses '7', we want to get a '7', not '&'. */
+
+#ifdef __APPLE__
+ /* gdkkeys-quartz.c does not implement gdk_keymap_lookup_key */
+ guint keyval;
+ gdk_keymap_translate_keyboard_state (NULL, event->hardware_keycode,
+ (GdkModifierType)0, 0,
+ &keyval, NULL, NULL, NULL);
+#else
+ GdkKeymapKey kk;
kk.keycode = event->hardware_keycode;
kk.level = 0;
kk.group = 0;
guint keyval = gdk_keymap_lookup_key (NULL, &kk);
+#endif
return gdk_keyval_name (gdk_keyval_to_lower (keyval));
}