[gtk+/gtk-2-24-quartz: 1/26] Handle alt/option modifier key with GDK_MOD5_MASK so that it's recognized as a modifier key for acce
- From: John Ralls <jralls src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-2-24-quartz: 1/26] Handle alt/option modifier key with GDK_MOD5_MASK so that it's recognized as a modifier key for acce
- Date: Mon, 3 Jan 2011 19:59:12 +0000 (UTC)
commit 689ee935c157d63df8ce11d9e8ce2f8da36da2cd
Author: John Ralls <jralls ceridwen us>
Date: Mon Dec 13 14:58:52 2010 -0800
Handle alt/option modifier key with GDK_MOD5_MASK so that it's recognized as a modifier key for accelerators.
gdk/quartz/gdkevents-quartz.c | 2 ++
gdk/quartz/gdkkeys-quartz.c | 10 ++++++++--
2 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/gdk/quartz/gdkevents-quartz.c b/gdk/quartz/gdkevents-quartz.c
index 1334d83..079e4fe 100644
--- a/gdk/quartz/gdkevents-quartz.c
+++ b/gdk/quartz/gdkevents-quartz.c
@@ -272,6 +272,8 @@ get_keyboard_modifiers_from_ns_event (NSEvent *nsevent)
modifiers |= GDK_CONTROL_MASK;
if (nsflags & NSCommandKeyMask)
modifiers |= GDK_MOD1_MASK;
+ if (nsflags & NSAlternateKeyMask)
+ modifiers |= GDK_MOD5_MASK;
return modifiers;
}
diff --git a/gdk/quartz/gdkkeys-quartz.c b/gdk/quartz/gdkkeys-quartz.c
index 52b0867..abad32f 100644
--- a/gdk/quartz/gdkkeys-quartz.c
+++ b/gdk/quartz/gdkkeys-quartz.c
@@ -656,14 +656,20 @@ void
gdk_keymap_add_virtual_modifiers (GdkKeymap *keymap,
GdkModifierType *state)
{
- /* FIXME: For now, we've mimiced the Windows backend. */
+ if (*state & GDK_MOD1_MASK)
+ *state |= GDK_META_MASK;
+ if (*state & GDK_MOD5_MASK)
+ *state |= GDK_SUPER_MASK;
}
gboolean
gdk_keymap_map_virtual_modifiers (GdkKeymap *keymap,
GdkModifierType *state)
{
- /* FIXME: For now, we've mimiced the Windows backend. */
+ if (*state & GDK_META_MASK)
+ *state |= GDK_MOD1_MASK;
+ if (*state & GDK_SUPER_MASK)
+ *state |= GDK_MOD5_MASK;
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]