~eliasnaur/gio

2a41ff9a59a8ebb1f2a0e150c8cf777aafe470c8 — Elias Naur 6 months ago b68c9c2
ui/key: expand documentation

Signed-off-by: Elias Naur <mail@eliasnaur.com>
1 files changed, 15 insertions(+), 0 deletions(-)

M ui/key/key.go
M ui/key/key.go => ui/key/key.go +15 -0
@@ 1,5 1,12 @@
// SPDX-License-Identifier: Unlicense OR MIT

/*
Package key implements key and text input handling.

The HandlerOp operations is used for declaring key
input handlers. Use the Queue interface from package
input to receive events.
*/
package key

import (


@@ 8,13 15,21 @@ import (
	"gioui.org/ui/internal/opconst"
)

// HandlerOp declares a handler ready for key events.
// Key events are in general only delivered to the
// focused key handler. Set the Focus flag to request
// the focus.
type HandlerOp struct {
	Key   input.Key
	Focus bool
}

// HideInputOp request that any on screen text input
// be hidden.
type HideInputOp struct{}

// FocusEvent is sent when a handler gains or looses
// focus.
type FocusEvent struct {
	Focus bool
}