mirror of
https://github.com/clearlinux/clr-installer.git
synced 2026-09-05 21:21:39 +00:00
Enable Escape key to cancel to previous page
Fixes #53 Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
This commit is contained in:
@@ -327,6 +327,19 @@ func (page *BasePage) setup(tui *Tui, id int, btns int, returnID int) {
|
||||
"Use [Tab] or the arrow keys [up and down] to navigate", Fixed)
|
||||
|
||||
page.window.SetVisible(false)
|
||||
|
||||
// Escape-key cancel's this screen and returns
|
||||
// same as the default 'Cancel' button
|
||||
page.window.OnKeyDown(func(ev clui.Event, data interface{}) bool {
|
||||
if ev.Key == term.KeyEsc {
|
||||
page.action = ActionCancelButton
|
||||
page.GotoPage(returnID)
|
||||
page.action = ActionNone
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}, nil)
|
||||
}
|
||||
|
||||
func (page *BasePage) newWindow() {
|
||||
|
||||
Reference in New Issue
Block a user