Skip to content

Commit

Permalink
update handle back button on androidf
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeBoy committed Oct 22, 2024
1 parent 158a43c commit 671a439
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ui/window.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,16 +414,17 @@ func (win *Window) listenSoftKey(gtx C) {
// check for presses of the back key.
if runtime.GOOS == "android" {
for {
event, ok := gtx.Event(key.FocusFilter{Target: win},
key.Filter{Focus: win, Name: key.NameBack},
)
event, ok := gtx.Event(key.Filter{
Name: key.NameBack,
})
if !ok {
break
}

switch event := event.(type) {
case key.Event:
if event.Name == key.NameBack && event.State == key.Press {
win.load.Toast.Notify("Back click")
win.load.Theme.OnTapBack()
}
}
Expand Down

0 comments on commit 671a439

Please sign in to comment.