aboutsummaryrefslogtreecommitdiff
path: root/ui/view-main.go
diff options
context:
space:
mode:
authorDigital <digidev@digitalville.de>2018-06-30 22:28:53 +0200
committerTulir Asokan <tulir@maunium.net>2018-06-30 23:28:53 +0300
commitcf3f3e51d127f12b0d4b602cf446c1befde9cd79 (patch)
tree08eaa5c689eff808825c4e64835708830f5bbd55 /ui/view-main.go
parentbf84fc09b216bd4669d9a0ed9bba30209f0cb7a8 (diff)
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)
Diffstat (limited to 'ui/view-main.go')
-rw-r--r--ui/view-main.go4
1 files changed, 4 insertions, 0 deletions
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()