From cf3f3e51d127f12b0d4b602cf446c1befde9cd79 Mon Sep 17 00:00:00 2001 From: Digital Date: Sat, 30 Jun 2018 22:28:53 +0200 Subject: Add support for more key events (#64) In some cases tcell sends Key{Ctrl,Alt}{Up,Down} events instead of Key{Up,Down} event that have the corresponding modifier mask set. (these key combinations are used for switching rooms) --- ui/view-main.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ui') diff --git a/ui/view-main.go b/ui/view-main.go index 40a6dcd..ef0f5d7 100644 --- a/ui/view-main.go +++ b/ui/view-main.go @@ -195,6 +195,10 @@ func (view *MainView) KeyEventHandler(roomView *RoomView, key *tcell.EventKey) * default: return key } + } else if k == tcell.KeyAltDown || k == tcell.KeyCtrlDown { + view.SwitchRoom(view.roomList.Next()) + } else if k == tcell.KeyAltUp || k == tcell.KeyCtrlUp { + view.SwitchRoom(view.roomList.Previous()) } else if k == tcell.KeyPgUp || k == tcell.KeyPgDn || k == tcell.KeyUp || k == tcell.KeyDown || k == tcell.KeyEnd || k == tcell.KeyHome { msgView := roomView.MessageView() -- cgit v1.2.3