diff options
| author | Pietro Gagliardi <[email protected]> | 2014-05-29 14:26:20 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-05-29 14:26:45 -0400 |
| commit | b648af160b36278a5c080e60d9c62e4061e6df1e (patch) | |
| tree | 07c83680a49c2b78e1fd2fe0097290bcc4c27dbf /area_darwin.go | |
| parent | 4bb028b976fd814a825cb0e5611893b59bb855b8 (diff) | |
Added new Modifiers code for Mac OS X. Also fixed some comment typos and added more TODOs.
Diffstat (limited to 'area_darwin.go')
| -rw-r--r-- | area_darwin.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/area_darwin.go b/area_darwin.go index 921b223..c380995 100644 --- a/area_darwin.go +++ b/area_darwin.go @@ -171,7 +171,7 @@ func areaView_flagsChanged(self C.id, e C.id) C.BOOL { var ke KeyEvent // Mac OS X sends this event on both key up and key down. - // Fortunately -[e keyCode] IS valid here, so we can simply map from key code to Modifiers, get the value of [e modifierFlags], the respective bit is set or not — that will give us the up/down state + // Fortunately -[e keyCode] IS valid here, so we can simply map from key code to Modifiers, get the value of [e modifierFlags], and check if the respective bit is set or not — that will give us the up/down state keyCode := uintptr(C.keyCode(e)) mod, ok := keycodeModifiers[keyCode] // comma-ok form to avoid adding entries if !ok { // unknown modifier; ignore @@ -179,5 +179,8 @@ func areaView_flagsChanged(self C.id, e C.id) C.BOOL { } ke.Modifiers = parseModifiers(e) ke.Up = (ke.Modifiers & mod) == 0 + ke.Modifier = mod + // don't include the modifier in ke.Modifiers + ke.Modifiers &^= mod return toBOOL(sendKeyEvent(self, e, ke)) } |
