mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 01:15:35 +00:00
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 <larry@theclapp.org>
This commit is contained in:
@@ -199,8 +199,8 @@ func (l *Selectable) Layout(gtx layout.Context, lt *text.Shaper, font font.Font,
|
|||||||
pointer.CursorText.Add(gtx.Ops)
|
pointer.CursorText.Add(gtx.Ops)
|
||||||
var keys key.Set
|
var keys key.Set
|
||||||
if l.focused {
|
if l.focused {
|
||||||
const keyFilterAllArrows = "(ShortAlt)-(Shift)-[←,→,↑,↓]|(Shift)-[⏎,⌤]|(ShortAlt)-(Shift)-[⌫,⌦]|(Shift)-[⇞,⇟,⇱,⇲]|Short-[C,V,X,A]|Short-(Shift)-Z"
|
const keyFilter = "(ShortAlt)-(Shift)-[←,→,↑,↓]|(Shift)-[⇞,⇟,⇱,⇲]|Short-[C,X,A]"
|
||||||
keys = keyFilterAllArrows
|
keys = keyFilter
|
||||||
}
|
}
|
||||||
key.InputOp{Tag: l, Keys: keys}.Add(gtx.Ops)
|
key.InputOp{Tag: l, Keys: keys}.Add(gtx.Ops)
|
||||||
if l.requestFocus {
|
if l.requestFocus {
|
||||||
|
|||||||
Reference in New Issue
Block a user