diff options
| author | citrons <citrons@mondecitronne.com> | 2025-06-05 14:58:42 -0500 |
|---|---|---|
| committer | citrons <citrons@mondecitronne.com> | 2025-06-07 16:02:18 -0500 |
| commit | f7392ac1dd02be1cb746d6101d4e94a77e8144f3 (patch) | |
| tree | 4eee68c91283f79e9230edd8f7719641f927f2ff /client/ui.go | |
| parent | 627a244b85dcfb75b547ec9bcd96b7db59c4e17a (diff) | |
alt+(1-9) for switching between channels
Diffstat (limited to 'client/ui.go')
| -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() { |
