summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-05-29 11:42:17 -0400
committerPietro Gagliardi <[email protected]>2014-05-29 11:42:17 -0400
commit1b23de9c786b9f32449ff0a6f02762b62d6732f8 (patch)
treef685fa5bea50eada893518b75943ee2e672808da
parent4045d50f946431408896a7b1512397c905e4bdb5 (diff)
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.
-rw-r--r--area.go16
1 files changed, 9 insertions, 7 deletions
diff --git a/area.go b/area.go
index 1cbcdb4..99f9683 100644
--- a/area.go
+++ b/area.go
@@ -179,13 +179,15 @@ type KeyEvent struct {
// was pressed. Key and ExtKey will not both be nonzero.
ExtKey ExtKey
- // (TODO Modifiers alone needs to be figured out)
- // If a Key or ExtKey is pressed with Modifiers, then the following events WILL be sent:
- // [Modifiers != 0, Key/ExtKey == 0] (as the Modifiers keypress(es) will register separately)
- // [Modifiers != 0, Key/ExtKey != 0]
- // and the following WILL NOT be:
- // [Modifiers == 0, Key/ExtKey != 0]
- // unless the Modifiers were pressed after/released before the Key/ExtKey was.
+ // If both Key and ExtKey are zero, Modifier will contain exactly one of its bits set, indicating which Modifier was pressed or released.
+ // As with Modifiers itself, there is no way to differentiate between left and right modifier keys.
+ // As such, the result of pressing and/or releasing both left and right of the same Modifier is system-defined.
+ // Furthermore, the result of holding down a Key or ExtKey, then pressing a Modifier, and then releasing the original key is system-defined.
+ // Under no condition shall Key, ExtKey, AND Modifier all be zero.
+ Modifier Modifiers
+
+ // 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
// If Up is true, the key was released; if not, the key was pressed.