From ea9b4bdfc2906c22601ba4b509eadb8fbc706d46 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Fri, 16 May 2014 18:39:08 -0400 Subject: [PATCH] Added (most of) the Super and Meta changes for GTK+. The Modifiers were already in the correct order. --- area_unix.go | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/area_unix.go b/area_unix.go index 8034a5f..ad44e02 100644 --- a/area_unix.go +++ b/area_unix.go @@ -95,12 +95,15 @@ func makeModifiers(state C.guint, m Modifiers) Modifiers { if (state & C.GDK_CONTROL_MASK) != 0 { m |= Ctrl } - if (state & C.GDK_META_MASK) != 0 { + if (state & C.GDK_META_MASK) != 0 { // TODO get equivalent for Alt m |= Alt } if (state & C.GDK_SHIFT_MASK) != 0 { m |= Shift } + if (state & C.GDK_SUPER_MASK) != 0 { + m |= Super + } return m } @@ -324,15 +327,14 @@ func init() { } var modonlykeys = map[C.guint]Modifiers{ - C.GDK_KEY_Shift_L: Shift, - C.GDK_KEY_Shift_R: Shift, C.GDK_KEY_Control_L: Ctrl, C.GDK_KEY_Control_R: Ctrl, - C.GDK_KEY_Meta_L: Alt, - C.GDK_KEY_Meta_R: Alt, - // my system generats these two for the Alt keys instead of Meta C.GDK_KEY_Alt_L: Alt, C.GDK_KEY_Alt_R: Alt, -// C.GDK_KEY_Super_L: Super, -// C.GDK_KEY_Super_R: Super, + C.GDK_KEY_Meta_L: Alt, + C.GDK_KEY_Meta_R: Alt, + C.GDK_KEY_Shift_L: Shift, + C.GDK_KEY_Shift_R: Shift, + C.GDK_KEY_Super_L: Super, + C.GDK_KEY_Super_R: Super, }