File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -124,6 +124,7 @@ export class KeycodeLayout implements IKeyboardLayout {
124124 * @returns `true` if the key is valid, `false` otherwise.
125125 */
126126 isValidKey ( key : string ) : boolean {
127+ key = Private . normalizeCtrl ( key ) ;
127128 return key in this . _keys || Private . isSpecialCharacter ( key ) ;
128129 }
129130
@@ -135,6 +136,7 @@ export class KeycodeLayout implements IKeyboardLayout {
135136 * @returns `true` if the key is a modifier key, `false` otherwise.
136137 */
137138 isModifierKey ( key : string ) : boolean {
139+ key = Private . normalizeCtrl ( key ) ;
138140 return key in this . _modifierKeys ;
139141 }
140142
@@ -236,4 +238,14 @@ namespace Private {
236238 // or more alphanumeric basic latin characters, it is likely a special key.
237239 return SPECIAL_KEYS . has ( key ) ;
238240 }
241+
242+ /**
243+ * Normalize Ctrl to Control for backwards compatability.
244+ *
245+ * @param key - The key value that is to be normalized
246+ * @returns The normalized key string
247+ */
248+ export function normalizeCtrl ( key : string ) : string {
249+ return key === "Ctrl" ? "Control" : key ;
250+ }
239251}
You can’t perform that action at this time.
0 commit comments