diff options
| -rw-r--r-- | client/ui.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/client/ui.go b/client/ui.go index a71a106..a6b6924 100644 --- a/client/ui.go +++ b/client/ui.go @@ -50,14 +50,24 @@ func (a *application) onInput(ev tui.Event) { prompt := a.getPrompt() prompt.Input().Update(ev) + wm := ev.Key.WithoutMods() + if wm > '0' && wm <= '9' { + i := wm - '1' + if int(i) < len(a.channelList) { + a.goTo(a.channelList[i].location) + } + } + buf := win.Buffer() buf.Scroll(-ev.Mouse.Scroll * 5) scroll := tui.Size().Height - 5 switch ev.Key { + case keys.PageUp: buf.Scroll(scroll) case keys.PageDown: buf.Scroll(-scroll) + case keys.Enter: input := prompt.Input() if !input.IsEmpty() { |
