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>
input.Event is enough if we stretch "input" to mean both input
devices and other events such as profiling events and system
commands.
The pointer and key packages are separate already, so I don't
expanding the meaning is unreasonable.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
Single stepping events only makes sense for widgets with complex
state, e.g. the text.Editor. For the input.Events source, returning
all events in a single Events call is sufficient and more natural
for clients.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
Change input.Events interface to return one event at a time until
the queue is empty.
Change text.Editor and gestures to match.
Re-add Editor.Submit while we're here; we don't want to enable
submit mode always.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
To avoid passing a queue type for each kind of input (pointer, key),
introduce package input for mapping a handler key to all input events.
Future input sources can be added without changes to programs, and
as an added bonus, event ordering is preserved across input sources.
Signed-off-by: Elias Naur <mail@eliasnaur.com>