Changed the Modifiers behavior in KeyEvent to more properly handle modifier keys. This is just the public interface for now; next comes all the backends.
This commit is contained in:
parent
4045d50f94
commit
1b23de9c78
16
area.go
16
area.go
|
@ -179,13 +179,15 @@ type KeyEvent struct {
|
||||||
// was pressed. Key and ExtKey will not both be nonzero.
|
// was pressed. Key and ExtKey will not both be nonzero.
|
||||||
ExtKey ExtKey
|
ExtKey ExtKey
|
||||||
|
|
||||||
// (TODO Modifiers alone needs to be figured out)
|
// If both Key and ExtKey are zero, Modifier will contain exactly one of its bits set, indicating which Modifier was pressed or released.
|
||||||
// If a Key or ExtKey is pressed with Modifiers, then the following events WILL be sent:
|
// As with Modifiers itself, there is no way to differentiate between left and right modifier keys.
|
||||||
// [Modifiers != 0, Key/ExtKey == 0] (as the Modifiers keypress(es) will register separately)
|
// As such, the result of pressing and/or releasing both left and right of the same Modifier is system-defined.
|
||||||
// [Modifiers != 0, Key/ExtKey != 0]
|
// Furthermore, the result of holding down a Key or ExtKey, then pressing a Modifier, and then releasing the original key is system-defined.
|
||||||
// and the following WILL NOT be:
|
// Under no condition shall Key, ExtKey, AND Modifier all be zero.
|
||||||
// [Modifiers == 0, Key/ExtKey != 0]
|
Modifier Modifiers
|
||||||
// unless the Modifiers were pressed after/released before the Key/ExtKey was.
|
|
||||||
|
// Modifiers contains all the modifier keys currently being held at the time of the KeyEvent.
|
||||||
|
// If Modifier is nonzero, Modifiers will not contain Modifier itself.
|
||||||
Modifiers Modifiers
|
Modifiers Modifiers
|
||||||
|
|
||||||
// If Up is true, the key was released; if not, the key was pressed.
|
// If Up is true, the key was released; if not, the key was pressed.
|
||||||
|
|
Loading…
Reference in New Issue