app,io/router: map Androids' DPAD_CENTER to a click

Mapping it to key.NameReturn confuses widgets such as Editor that
treats clicks separate from return key presses.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2022-02-28 14:24:17 +01:00
parent 2bea9a3736
commit 21431975de
4 changed files with 31 additions and 1 deletions
+6
View File
@@ -510,6 +510,12 @@ func (c *callbacks) MoveFocus(dir router.FocusDirection) {
c.w.updateAnimation(c.d)
}
func (c *callbacks) ClickFocus() {
c.w.queue.q.ClickFocus()
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