File tree 1 file changed +12
-0
lines changed
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 {
124
124
* @returns `true` if the key is valid, `false` otherwise.
125
125
*/
126
126
isValidKey ( key : string ) : boolean {
127
+ key = Private . normalizeCtrl ( key ) ;
127
128
return key in this . _keys || Private . isSpecialCharacter ( key ) ;
128
129
}
129
130
@@ -135,6 +136,7 @@ export class KeycodeLayout implements IKeyboardLayout {
135
136
* @returns `true` if the key is a modifier key, `false` otherwise.
136
137
*/
137
138
isModifierKey ( key : string ) : boolean {
139
+ key = Private . normalizeCtrl ( key ) ;
138
140
return key in this . _modifierKeys ;
139
141
}
140
142
@@ -236,4 +238,14 @@ namespace Private {
236
238
// or more alphanumeric basic latin characters, it is likely a special key.
237
239
return SPECIAL_KEYS . has ( key ) ;
238
240
}
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
+ }
239
251
}
You can’t perform that action at this time.
0 commit comments