add ctrl+c exit handler

This commit is contained in:
Bradley Cicenas 2017-03-09 05:29:34 +00:00
parent 8a6808c804
commit 2f17a9d689

14
grid.go
View File

@ -77,17 +77,16 @@ func Display() bool {
cursor.RefreshContainers()
RedrawRows(true)
ui.Handle("/sys/kbd/<up>", func(ui.Event) {
cursor.Up()
})
ui.Handle("/sys/kbd/<down>", func(ui.Event) {
cursor.Down()
})
ui.Handle("/sys/kbd/<up>", func(ui.Event) { cursor.Up() })
ui.Handle("/sys/kbd/<down>", func(ui.Event) { cursor.Down() })
ui.Handle("/sys/kbd/<enter>", func(ui.Event) {
expand = true
ui.StopLoop()
})
ui.Handle("/sys/kbd/q", func(ui.Event) { ui.StopLoop() })
ui.Handle("/sys/kbd/C-c", func(ui.Event) { ui.StopLoop() })
ui.Handle("/sys/kbd/a", func(ui.Event) {
config.Toggle("allContainers")
RefreshDisplay()
@ -107,9 +106,6 @@ func Display() bool {
config.Toggle("enableHeader")
RedrawRows(true)
})
ui.Handle("/sys/kbd/q", func(ui.Event) {
ui.StopLoop()
})
ui.Handle("/sys/kbd/r", func(e ui.Event) {
config.Toggle("sortReversed")
})