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

Function parseKeyModifier

key.go:184–206  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

182}
183
184func parseKeyModifier(s string) (tcell.ModMask, string) {
185 matches := reModKey.FindStringSubmatch(s)
186 if matches == nil {
187 return tcell.ModNone, s
188 }
189
190 mod := tcell.ModNone
191 switch matches[1] {
192 case "c":
193 mod = tcell.ModCtrl
194 case "s":
195 mod = tcell.ModShift
196 case "a":
197 mod = tcell.ModAlt
198 }
199
200 s = matches[2]
201 if len(s) > 1 {
202 s = "<" + s + ">"
203 }
204
205 return mod, s
206}
207
208func parseKey(s string) *tcell.EventKey {
209 if key, ok := gValKey[s]; ok {

Callers 1

parseKeyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected