all: rename io/event.Key to Tag

Key had an unfortunate association with keyboard input.

This is an API change. The following rewrites were run to fixup
Gio code:

        $ gofmt -r 'pointer.InputOp{Key:a} -> pointer.InputOp{Tag:a}' -w .
        $ gofmt -r 'pointer.InputOp{Key:a, Grab:b} -> pointer.InputOp{Tag:a, Grab:b}' -w .
        $ gofmt -r 'key.InputOp{Key:a} -> key.InputOp{Tag:a}' -w .
        $ gofmt -r 'key.InputOp{Key:a, Focus:b} -> key.InputOp{Tag:a, Focus:b}' -w .
        $ gofmt -r 'event.Key -> event.Tag' -w .

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2020-05-17 19:48:12 +02:00
parent e89277951c
commit 03db2817ac
12 changed files with 63 additions and 63 deletions
+7 -7
View File
@@ -25,7 +25,7 @@ The following example declares a handler ready for key input:
ops := new(op.Ops)
var h *Handler = ...
key.InputOp{Key: h}.Add(ops)
key.InputOp{Tag: h}.Add(ops)
*/
package event
@@ -33,14 +33,14 @@ package event
// Queue maps an event handler key to the events
// available to the handler.
type Queue interface {
// Events returns the available events for a
// Key.
Events(k Key) []Event
// Events returns the available events for an
// event handler tag.
Events(t Tag) []Event
}
// Key is the stable identifier for an event handler.
// For a handler h, the key is typically &h.
type Key interface{}
// Tag is the stable identifier for an event handler.
// For a handler h, the tag is typically &h.
type Tag interface{}
// Event is the marker interface for events.
type Event interface {