Show key name in raw pane

This commit is contained in:
Zachary Yedidia
2020-06-09 15:57:52 -04:00
parent 1f58eecf3c
commit 0654db334a

View File

@@ -35,6 +35,13 @@ func (h *RawPane) HandleEvent(event tcell.Event) {
}
h.Buf.Insert(h.Cursor.Loc, reflect.TypeOf(event).String()[7:])
switch e := event.(type) {
case *tcell.EventKey:
h.Buf.Insert(h.Cursor.Loc, fmt.Sprintf(": %s", e.Name()))
}
h.Buf.Insert(h.Cursor.Loc, fmt.Sprintf(": %q\n", event.EscSeq()))
h.Relocate()
}