diff options
Diffstat (limited to 'area_windows.go')
| -rw-r--r-- | area_windows.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/area_windows.go b/area_windows.go index 5664ffa..6269002 100644 --- a/area_windows.go +++ b/area_windows.go @@ -513,6 +513,10 @@ func areaKeyEvent(s *sysData, up bool, wparam _WPARAM, lparam _LPARAM) bool { ke.ExtKey = NEnter } else if extkey, ok := extkeys[wparam]; ok { ke.ExtKey = extkey + } else if mod, ok := modonlykeys[wparam]; ok { + ke.Modifier = mod + // don't include the modifier in ke.Modifiers + ke.Modifiers &^= mod } else if xke, ok := fromScancode(uintptr(scancode)); ok { // one of these will be nonzero ke.Key = xke.Key @@ -580,6 +584,22 @@ func init() { } } +var modonlykeys = map[_WPARAM]Modifiers{ + // TODO except for Super, are the separate left/right necessary? + _VK_CONTROL: Ctrl, + _VK_LCONTROL: Ctrl, + _VK_RCONTROL: Ctrl, + _VK_MENU: Alt, + _VK_LMENU: Alt, + _VK_RMENU: Alt, + _VK_SHIFT: Shift, + _VK_LSHIFT: Shift, + _VK_RSHIFT: Shift, + // there's no combined Windows key virtual-key code as there is with the others + _VK_LWIN: Super, + _VK_RWIN: Super, +} + var ( _setFocus = user32.NewProc("SetFocus") ) |
