CanonicalID returns a unique identifier for a parsed key combination.
(key tcell.Key, r rune, mod tcell.ModMask)
| 140 | |
| 141 | // CanonicalID returns a unique identifier for a parsed key combination. |
| 142 | func CanonicalID(key tcell.Key, r rune, mod tcell.ModMask) string { |
| 143 | if key == tcell.KeyRune { |
| 144 | r = unicode.ToLower(r) |
| 145 | } |
| 146 | |
| 147 | return fmt.Sprintf("%d:%d:%d", key, r, mod) |
| 148 | } |
| 149 | |
| 150 | // IsReserved reports whether the given key combination is reserved for |
| 151 | // navigation and should not be reassigned. Only unmodified keys are checked. |
no outgoing calls