forked from joejulian/gio
73b1e64209
By returning all events, widgets that might return early from its
event loop might throw away subsequent events. Instead of requiring
those widgets to store the event list, convert input.Queue to step
through the available events one at a time.
Functional revert of 1735d5ced8.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
21 lines
553 B
Go
21 lines
553 B
Go
// SPDX-License-Identifier: Unlicense OR MIT
|
|
|
|
// Package input exposes a unified interface to input sources. Subpackages
|
|
// such as pointer and key provide the interfaces for specific input types.
|
|
package input
|
|
|
|
// Queue maps an event handler key to the events
|
|
// available to the handler.
|
|
type Queue interface {
|
|
Next(k Key) (Event, bool)
|
|
}
|
|
|
|
// Key is the stable identifier for an event handler.
|
|
// For a handler h, the key is typically &h.
|
|
type Key interface{}
|
|
|
|
// Event is the marker interface for events.
|
|
type Event interface {
|
|
ImplementsEvent()
|
|
}
|