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

Function addKeyModifier

key.go:147–162  ·  view source on GitHub ↗
(s string, mod tcell.ModMask)

Source from the content-addressed store, hash-verified

145}
146
147func addKeyModifier(s string, mod tcell.ModMask) string {
148 if reModKey.MatchString(s) {
149 return s
150 }
151
152 switch {
153 case mod&tcell.ModCtrl != 0:
154 return wrapModifier(s, "c")
155 case mod&tcell.ModShift != 0:
156 return wrapModifier(s, "s")
157 case mod&tcell.ModAlt != 0:
158 return wrapModifier(s, "a")
159 default:
160 return s
161 }
162}
163
164func readKey(ev *tcell.EventKey) string {
165 var s string

Callers 1

readKeyFunction · 0.85

Calls 1

wrapModifierFunction · 0.85

Tested by

no test coverage detected