mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 18:05:35 +00:00
all: [API] replace tag parameter of Source.Event with per-filter tags
Until now, every event has had a particular target. We're about to simplify key event delivery to match the first matching filter, so there is no longer a global meaning to the tag argument to Source.Event. Add fields to filters to specify their target tags. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+8
-3
@@ -18,8 +18,9 @@ import (
|
||||
"gioui.org/op"
|
||||
)
|
||||
|
||||
// Filter matches [Event]s.
|
||||
// Filter matches any [Event] that matches the parameters.
|
||||
type Filter struct {
|
||||
Target event.Tag
|
||||
// Required is the set of modifiers that must be included in events matched.
|
||||
Required Modifiers
|
||||
// Optional is the set of modifiers that may be included in events matched.
|
||||
@@ -108,8 +109,12 @@ type EditEvent struct {
|
||||
Text string
|
||||
}
|
||||
|
||||
// FocusFilter matches [FocusEvent]s.
|
||||
type FocusFilter struct{}
|
||||
// FocusFilter matches any [FocusEvent], [EditEvent], [SnippetEvent],
|
||||
// or [SelectionEvent] with the specified target.
|
||||
type FocusFilter struct {
|
||||
// Target is a tag specified in a previous event.Op.
|
||||
Target event.Tag
|
||||
}
|
||||
|
||||
// InputHint changes the on-screen-keyboard type. That hints the
|
||||
// type of data that might be entered by the user.
|
||||
|
||||
Reference in New Issue
Block a user