key: add ModCtrl, ModShortcut

ModCtrl is the physical Ctrl key, ModShortcut is the virtual
"shortcut" modifier, which is Ctrl on most platforms, Command on
Apple platforms.

Updates #59

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-11-08 18:02:26 +01:00
parent 1eaa5dd15e
commit d293dfe604
6 changed files with 30 additions and 10 deletions
+1 -1
View File
@@ -124,7 +124,7 @@ func (x *Context) DispatchKey(keyCode uint32) (events []event.Event) {
if n, ok := convertKeysym(sym); ok {
cmd := key.Event{Name: n}
if C.xkb_state_mod_name_is_active(x.state, (*C.char)(unsafe.Pointer(&_XKB_MOD_NAME_CTRL[0])), C.XKB_STATE_MODS_EFFECTIVE) == 1 {
cmd.Modifiers |= key.ModCommand
cmd.Modifiers |= key.ModCtrl
}
if C.xkb_state_mod_name_is_active(x.state, (*C.char)(unsafe.Pointer(&_XKB_MOD_NAME_SHIFT[0])), C.XKB_STATE_MODS_EFFECTIVE) == 1 {
cmd.Modifiers |= key.ModShift