mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 18:05:35 +00:00
app: send keypress events for modifier keys
This change causes modifier keys (Control, Shift, Alt, Super) to be sent to the application as key.Event events. These will still continue to be used as modifiers for other key and pointer events as they are today. This commit also adds a minor cleanup to use constants for function keys in the OS-specific keypress handling functions. Signed-off-by: Jeff Williams <kanobe@gmail.com>
This commit is contained in:
committed by
Elias Naur
parent
fcaadb3698
commit
13183522dd
@@ -905,6 +905,14 @@ func convertKeyCode(code C.jint) (string, bool) {
|
||||
n = key.NameEnter
|
||||
case C.AKEYCODE_ENTER:
|
||||
n = key.NameEnter
|
||||
case C.AKEYCODE_CTRL_LEFT, C.AKEYCODE_CTRL_RIGHT:
|
||||
n = key.NameCtrl
|
||||
case C.AKEYCODE_SHIFT_LEFT, C.AKEYCODE_SHIFT_RIGHT:
|
||||
n = key.NameShift
|
||||
case C.AKEYCODE_ALT_LEFT, C.AKEYCODE_ALT_RIGHT:
|
||||
n = key.NameAlt
|
||||
case C.AKEYCODE_META_LEFT, C.AKEYCODE_META_RIGHT:
|
||||
n = key.NameSuper
|
||||
default:
|
||||
return "", false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user