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

Function parseKey

key.go:208–231  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

206}
207
208func parseKey(s string) *tcell.EventKey {
209 if key, ok := gValKey[s]; ok {
210 return tcell.NewEventKey(key, "", tcell.ModNone)
211 }
212
213 mod, s := parseKeyModifier(s)
214
215 k := tcell.KeyRune
216 if key, ok := gValKey[s]; ok {
217 k = key
218 s = ""
219 } else {
220 switch s {
221 case "<lt>":
222 s = "<"
223 case "<gt>":
224 s = ">"
225 case "<space>":
226 s = " "
227 }
228 }
229
230 return tcell.NewEventKey(k, s, mod)
231}

Callers 2

TestParseKeyFunction · 0.85
evalMethod · 0.85

Calls 1

parseKeyModifierFunction · 0.85

Tested by 1

TestParseKeyFunction · 0.68