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)
This commit is contained in:
parent
bf84fc09b2
commit
cf3f3e51d1
@ -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()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user