add Escape quit on main

This commit is contained in:
cuu 2018-06-20 11:17:58 +08:00
parent 273befd848
commit ab812e2a33

View File

@ -59,7 +59,7 @@ func run() int {
fmt.Println("UserEvent: ",ev.Data["Msg"]) fmt.Println("UserEvent: ",ev.Data["Msg"])
} }
if ev.Type == event.KEYDOWN { if ev.Type == event.KEYDOWN {
if ev.Data["Key"] == "Q" { if ev.Data["Key"] == "Q" || ev.Data["Key"] == "Escape" {
main_screen.OnExitCb() main_screen.OnExitCb()
return 0 return 0
}else if ev.Data["Key"] == "D" { }else if ev.Data["Key"] == "D" {