(s string)
| 182 | } |
| 183 | |
| 184 | func 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 | |
| 208 | func parseKey(s string) *tcell.EventKey { |
| 209 | if key, ok := gValKey[s]; ok { |