diff --git a/cmd/krampus19/changesettings.go b/cmd/krampus19/changesettings.go index ad52b5d..8ce7cb2 100644 --- a/cmd/krampus19/changesettings.go +++ b/cmd/krampus19/changesettings.go @@ -280,6 +280,7 @@ func (s *changeSettings) Enter(ctx *Context) error { ) buttons := &alui.StackPanel{Orientation: alui.OrientationHorizontal} buttons.AddChild( + newWideButton("Cancel", func() { s.ctx.Navigation.ShowMainMenu() }), newWideButton("Apply", func() { var controls = controls{MoveLeft: keyLeft.Key, MoveUp: keyUp.Key, MoveRight: keyRight.Key, MoveDown: keyDown.Key} var video = video{Windowed: windowed.Selected, DisplayMode: displayMode.Mode()} @@ -293,11 +294,22 @@ func (s *changeSettings) Enter(ctx *Context) error { s.ctx.Navigation.ShowMainMenu() }), - newWideButton("Cancel", func() { s.ctx.Navigation.ShowMainMenu() }), ) s.AddChild(alui.Center(buttons)) return nil } +func (s *changeSettings) Handle(e allg5.Event) { + s.Column.Handle(e) + + switch e := e.(type) { + case *allg5.KeyDownEvent: + switch e.KeyCode { + case allg5.KeyEscape: + s.ctx.Navigation.ShowMainMenu() + } + } +} + func (s *changeSettings) Leave() { }