From ae2b1f42b27d4125eaa110bf51c81a1efea3b2ea Mon Sep 17 00:00:00 2001 From: Larry Clapp Date: Fri, 13 Oct 2023 16:12:21 -0400 Subject: [PATCH] widget: Update Selectable key filter Selectable was using a key event filter copied directly from editor.go, but it didn't actually process all those keys. Update the filter to only ask for the keys that Selectable actually uses. Signed-off-by: Larry Clapp --- widget/selectable.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/widget/selectable.go b/widget/selectable.go index 882b3672..d3084746 100644 --- a/widget/selectable.go +++ b/widget/selectable.go @@ -199,8 +199,8 @@ func (l *Selectable) Layout(gtx layout.Context, lt *text.Shaper, font font.Font, pointer.CursorText.Add(gtx.Ops) var keys key.Set if l.focused { - const keyFilterAllArrows = "(ShortAlt)-(Shift)-[←,→,↑,↓]|(Shift)-[⏎,⌤]|(ShortAlt)-(Shift)-[⌫,⌦]|(Shift)-[⇞,⇟,⇱,⇲]|Short-[C,V,X,A]|Short-(Shift)-Z" - keys = keyFilterAllArrows + const keyFilter = "(ShortAlt)-(Shift)-[←,→,↑,↓]|(Shift)-[⇞,⇟,⇱,⇲]|Short-[C,X,A]" + keys = keyFilter } key.InputOp{Tag: l, Keys: keys}.Add(gtx.Ops) if l.requestFocus {