mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 01:15:35 +00:00
io/router,app: add support for directional focus moves
Implement support for up/down/right/left directional focus moves and map Android directional pad keys to focus moves. Fixes: https://todo.sr.ht/~eliasnaur/gio/195 References: https://github.com/tailscale/tailscale/issues/1611 Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -504,6 +504,12 @@ func (c *callbacks) SetEditorSnippet(r key.Range) {
|
||||
c.Event(key.SnippetEvent(r))
|
||||
}
|
||||
|
||||
func (c *callbacks) MoveFocus(dir router.FocusDirection) {
|
||||
c.w.queue.q.MoveFocus(dir)
|
||||
c.w.setNextFrame(time.Time{})
|
||||
c.w.updateAnimation(c.d)
|
||||
}
|
||||
|
||||
func (e *editorState) Replace(r key.Range, text string) {
|
||||
if r.Start > r.End {
|
||||
r.Start, r.End = r.End, r.Start
|
||||
|
||||
Reference in New Issue
Block a user