commit
ff20c2c44f
@ -322,14 +322,16 @@ func (view *RoomView) ClearAllContext() {
|
|||||||
func (view *RoomView) OnKeyEvent(event mauview.KeyEvent) bool {
|
func (view *RoomView) OnKeyEvent(event mauview.KeyEvent) bool {
|
||||||
msgView := view.MessageView()
|
msgView := view.MessageView()
|
||||||
if view.selecting {
|
if view.selecting {
|
||||||
switch event.Key() {
|
k := event.Key()
|
||||||
case tcell.KeyEscape:
|
c := event.Rune()
|
||||||
|
switch {
|
||||||
|
case k == tcell.KeyEscape || c == 'h':
|
||||||
view.ClearAllContext()
|
view.ClearAllContext()
|
||||||
case tcell.KeyUp:
|
case k == tcell.KeyUp || c == 'k':
|
||||||
view.SelectPrevious()
|
view.SelectPrevious()
|
||||||
case tcell.KeyDown:
|
case k == tcell.KeyDown || c == 'j':
|
||||||
view.SelectNext()
|
view.SelectNext()
|
||||||
case tcell.KeyEnter:
|
case k == tcell.KeyEnter || c == 'l':
|
||||||
view.OnSelect(msgView.selected)
|
view.OnSelect(msgView.selected)
|
||||||
default:
|
default:
|
||||||
return false
|
return false
|
||||||
|
Loading…
Reference in New Issue
Block a user