aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2020-04-09 18:20:12 +0300
committerGitHub <noreply@github.com>2020-04-09 18:20:12 +0300
commitff20c2c44f86b40f9214f1dc3d339584e48374f1 (patch)
treef182427bb0203183f64143a1b036c5f3ff190a0c /ui
parent0d98ac466bbfa6e84f445dc119c96191bcdb6c81 (diff)
parent8b02b30e587b42eb446d623e966dc05deefeb180 (diff)
Merge pull request #142 from Midek/burdel
hjkl keybinds for selection
Diffstat (limited to 'ui')
-rw-r--r--ui/room-view.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/ui/room-view.go b/ui/room-view.go
index 29c455d..3a1d3cb 100644
--- a/ui/room-view.go
+++ b/ui/room-view.go
@@ -322,14 +322,16 @@ func (view *RoomView) ClearAllContext() {
func (view *RoomView) OnKeyEvent(event mauview.KeyEvent) bool {
msgView := view.MessageView()
if view.selecting {
- switch event.Key() {
- case tcell.KeyEscape:
+ k := event.Key()
+ c := event.Rune()
+ switch {
+ case k == tcell.KeyEscape || c == 'h':
view.ClearAllContext()
- case tcell.KeyUp:
+ case k == tcell.KeyUp || c == 'k':
view.SelectPrevious()
- case tcell.KeyDown:
+ case k == tcell.KeyDown || c == 'j':
view.SelectNext()
- case tcell.KeyEnter:
+ case k == tcell.KeyEnter || c == 'l':
view.OnSelect(msgView.selected)
default:
return false