io/key: [API] introduce FocusFilter for matching focus and editor events

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2023-10-19 18:31:07 -05:00
parent 12a0ad7038
commit 73c3849da4
8 changed files with 127 additions and 60 deletions
+1 -1
View File
@@ -304,7 +304,7 @@ func (e *Selectable) clickDragEvents(gtx layout.Context) []event.Event {
}
func (e *Selectable) processKey(gtx layout.Context) {
for _, ke := range gtx.Events(e) {
for _, ke := range gtx.Events(e, key.FocusFilter{}) {
switch ke := ke.(type) {
case key.FocusEvent:
e.focused = ke.Focus