MCPcopy Create free account
hub / github.com/gokcehan/lf / readKey

Function readKey

key.go:164–182  ·  view source on GitHub ↗
(ev *tcell.EventKey)

Source from the content-addressed store, hash-verified

162}
163
164func readKey(ev *tcell.EventKey) string {
165 var s string
166 if ev.Key() == tcell.KeyRune {
167 switch ev.Str() {
168 case "<":
169 s = "<lt>"
170 case ">":
171 s = "<gt>"
172 case " ":
173 s = "<space>"
174 default:
175 s = ev.Str()
176 }
177 } else {
178 s = gKeyVal[ev.Key()]
179 }
180
181 return addKeyModifier(s, ev.Modifiers())
182}
183
184func parseKeyModifier(s string) (tcell.ModMask, string) {
185 matches := reModKey.FindStringSubmatch(s)

Callers 3

TestReadKeyFunction · 0.85
readNormalEventMethod · 0.85
readCmdEventFunction · 0.85

Calls 1

addKeyModifierFunction · 0.85

Tested by 1

TestReadKeyFunction · 0.68