From dc179b3a44581d0e2da5748c69792de7b98d96a6 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Fri, 16 May 2014 19:52:28 -0400 Subject: [PATCH] Implemented the Super and order changes on Mac OS X. Meta is irrelevant here. --- area_darwin.go | 10 +++++----- events_darwin.go | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/area_darwin.go b/area_darwin.go index 0d95adf..6fc3a9b 100644 --- a/area_darwin.go +++ b/area_darwin.go @@ -51,17 +51,17 @@ func parseModifiers(e C.id) (m Modifiers) { ) mods := uintptr(C.modifierFlags(e)) - if (mods & _NSShiftKeyMask) != 0 { - m |= Shift - } if (mods & _NSControlKeyMask) != 0 { - // TODO + m |= Ctrl } if (mods & _NSAlternateKeyMask) != 0 { m |= Alt } + if (mods & _NSShiftKeyMask) != 0 { + m |= Shift + } if (mods & _NSCommandKeyMask) != 0 { - m |= Ctrl + m |= Super } return m } diff --git a/events_darwin.go b/events_darwin.go index 5ccca72..e5e4f9e 100644 --- a/events_darwin.go +++ b/events_darwin.go @@ -107,17 +107,17 @@ var keycodeExtKeys = map[uintptr]ExtKey{ } var keycodeModifiers = map[uintptr]Modifiers{ - 0x37: Ctrl, // left command + 0x37: Super, // left command 0x38: Shift, // left shift 0x3A: Alt, // left option -// 0x3B: kVK_Control, + 0x3B: Ctrl, // left control 0x3C: Shift, // right shift 0x3D: Alt, // right alt -// 0x3E: kVK_RightControl, + 0x3E: Ctrl, // right control // the following is not in Events.h for some reason // thanks to Nicole and jedivulcan from irc.badnik.net - 0x36: Ctrl, // right command + 0x36: Super, // right command } func fromKeycode(keycode uintptr) (ke KeyEvent, ok bool) {