From 38ad3a23739160f121b0e2c8c31e41d998a4d4c5 Mon Sep 17 00:00:00 2001 From: Andy Williams Date: Sat, 29 Jul 2023 10:55:49 -0400 Subject: [PATCH] And if nobody handles the event go back as expected --- internal/driver/mobile/driver.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/internal/driver/mobile/driver.go b/internal/driver/mobile/driver.go index 2ec9b00021..104157b58e 100644 --- a/internal/driver/mobile/driver.go +++ b/internal/driver/mobile/driver.go @@ -515,8 +515,12 @@ func (d *mobileDriver) typeDownCanvas(canvas *mobileCanvas, r rune, code key.Cod canvas.Focused().TypedRune(r) } } else { - if keyName != "" && canvas.onTypedKey != nil { - canvas.onTypedKey(keyEvent) + if keyName != "" { + if canvas.onTypedKey != nil { + canvas.onTypedKey(keyEvent) + } else if keyName == mobile.KeyBack { + d.GoBack() + } } if r > 0 && canvas.onTypedRune != nil { canvas.onTypedRune(r)