Move room switcher to ctrl+k and newline to alt+enter. Fixes #132

This commit is contained in:
Tulir Asokan 2020-04-03 23:46:50 +03:00
parent bce30e32a0
commit 0a493d643c

View File

@ -183,7 +183,7 @@ func (view *MainView) OnKeyEvent(event mauview.KeyEvent) bool {
view.SwitchRoom(view.roomList.Next()) view.SwitchRoom(view.roomList.Next())
case k == tcell.KeyUp: case k == tcell.KeyUp:
view.SwitchRoom(view.roomList.Previous()) view.SwitchRoom(view.roomList.Previous())
case k == tcell.KeyEnter: case c == 'k' || k == tcell.KeyCtrlK:
view.ShowModal(NewFuzzySearchModal(view, 42, 12)) view.ShowModal(NewFuzzySearchModal(view, 42, 12))
case k == tcell.KeyHome: case k == tcell.KeyHome:
msgView := view.currentRoom.MessageView() msgView := view.currentRoom.MessageView()
@ -191,7 +191,7 @@ func (view *MainView) OnKeyEvent(event mauview.KeyEvent) bool {
case k == tcell.KeyEnd: case k == tcell.KeyEnd:
msgView := view.currentRoom.MessageView() msgView := view.currentRoom.MessageView()
msgView.AddScrollOffset(-msgView.TotalHeight()) msgView.AddScrollOffset(-msgView.TotalHeight())
case c == 'n' || k == tcell.KeyCtrlN: case k == tcell.KeyEnter:
return view.flex.OnKeyEvent(tcell.NewEventKey(tcell.KeyEnter, '\n', event.Modifiers()|tcell.ModShift, "")) return view.flex.OnKeyEvent(tcell.NewEventKey(tcell.KeyEnter, '\n', event.Modifiers()|tcell.ModShift, ""))
case c == 'a': case c == 'a':
view.SwitchRoom(view.roomList.NextWithActivity()) view.SwitchRoom(view.roomList.NextWithActivity())