mirror of
https://github.com/bcicen/ctop.git
synced 2025-12-06 15:16:41 +08:00
add keymap, handle wrapper for common keybindings
This commit is contained in:
8
menus.go
8
menus.go
@@ -81,11 +81,15 @@ func SortMenu() {
|
||||
// set cursor position to current sort field
|
||||
m.SetCursor(config.GetVal("sortField"))
|
||||
|
||||
ui.Render(m)
|
||||
m.NavigationHandlers()
|
||||
HandleKeys("up", m.Up)
|
||||
HandleKeys("down", m.Down)
|
||||
HandleKeys("exit", ui.StopLoop)
|
||||
|
||||
ui.Handle("/sys/kbd/<enter>", func(ui.Event) {
|
||||
config.Update("sortField", m.SelectedItem().Val)
|
||||
ui.StopLoop()
|
||||
})
|
||||
|
||||
ui.Render(m)
|
||||
ui.Loop()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user