mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 02:15:34 +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:
+6
-1
@@ -148,6 +148,10 @@ func (q *Router) Queue(events ...event.Event) bool {
|
||||
return q.handlers.HadEvents()
|
||||
}
|
||||
|
||||
func (q *Router) MoveFocus(dir FocusDirection) {
|
||||
q.key.queue.MoveFocus(dir, &q.handlers)
|
||||
}
|
||||
|
||||
// TextInputState returns the input state from the most recent
|
||||
// call to Frame.
|
||||
func (q *Router) TextInputState() TextInputState {
|
||||
@@ -316,7 +320,8 @@ func (q *Router) collect() {
|
||||
Tag: encOp.Refs[0].(event.Tag),
|
||||
Hint: key.InputHint(encOp.Data[1]),
|
||||
}
|
||||
kc.inputOp(op)
|
||||
b := pc.currentAreaBounds()
|
||||
kc.inputOp(op, b)
|
||||
case ops.TypeSnippet:
|
||||
op := key.SnippetOp{
|
||||
Tag: encOp.Refs[0].(event.Tag),
|
||||
|
||||
Reference in New Issue
Block a user