Implemented the Super and order changes on Mac OS X. Meta is irrelevant here.
This commit is contained in:
parent
5176b0e9dd
commit
dc179b3a44
|
@ -51,17 +51,17 @@ func parseModifiers(e C.id) (m Modifiers) {
|
||||||
)
|
)
|
||||||
|
|
||||||
mods := uintptr(C.modifierFlags(e))
|
mods := uintptr(C.modifierFlags(e))
|
||||||
if (mods & _NSShiftKeyMask) != 0 {
|
|
||||||
m |= Shift
|
|
||||||
}
|
|
||||||
if (mods & _NSControlKeyMask) != 0 {
|
if (mods & _NSControlKeyMask) != 0 {
|
||||||
// TODO
|
m |= Ctrl
|
||||||
}
|
}
|
||||||
if (mods & _NSAlternateKeyMask) != 0 {
|
if (mods & _NSAlternateKeyMask) != 0 {
|
||||||
m |= Alt
|
m |= Alt
|
||||||
}
|
}
|
||||||
|
if (mods & _NSShiftKeyMask) != 0 {
|
||||||
|
m |= Shift
|
||||||
|
}
|
||||||
if (mods & _NSCommandKeyMask) != 0 {
|
if (mods & _NSCommandKeyMask) != 0 {
|
||||||
m |= Ctrl
|
m |= Super
|
||||||
}
|
}
|
||||||
return m
|
return m
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,17 +107,17 @@ var keycodeExtKeys = map[uintptr]ExtKey{
|
||||||
}
|
}
|
||||||
|
|
||||||
var keycodeModifiers = map[uintptr]Modifiers{
|
var keycodeModifiers = map[uintptr]Modifiers{
|
||||||
0x37: Ctrl, // left command
|
0x37: Super, // left command
|
||||||
0x38: Shift, // left shift
|
0x38: Shift, // left shift
|
||||||
0x3A: Alt, // left option
|
0x3A: Alt, // left option
|
||||||
// 0x3B: kVK_Control,
|
0x3B: Ctrl, // left control
|
||||||
0x3C: Shift, // right shift
|
0x3C: Shift, // right shift
|
||||||
0x3D: Alt, // right alt
|
0x3D: Alt, // right alt
|
||||||
// 0x3E: kVK_RightControl,
|
0x3E: Ctrl, // right control
|
||||||
|
|
||||||
// the following is not in Events.h for some reason
|
// the following is not in Events.h for some reason
|
||||||
// thanks to Nicole and jedivulcan from irc.badnik.net
|
// 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) {
|
func fromKeycode(keycode uintptr) (ke KeyEvent, ok bool) {
|
||||||
|
|
Loading…
Reference in New Issue