diff --git a/src/keyboard/keyMap.ts b/src/keyboard/keyMap.ts index 51afcd2f..47465064 100644 --- a/src/keyboard/keyMap.ts +++ b/src/keyboard/keyMap.ts @@ -18,6 +18,10 @@ export const defaultKeyMap: keyboardKey[] = [ // alphanumeric block - functional {code: 'Space', key: ' '}, + {code: 'BracketLeft', key: '['}, + {code: 'BracketRight', key: ']'}, + {code: 'BracketLeft', key: '{', shiftKey: true}, + {code: 'BracketRight', key: '}', shiftKey: true}, {code: 'AltLeft', key: 'Alt', location: DOM_KEY_LOCATION.LEFT}, {code: 'AltRight', key: 'Alt', location: DOM_KEY_LOCATION.RIGHT}, diff --git a/tests/keyboard/parseKeyDef.ts b/tests/keyboard/parseKeyDef.ts index 1dd6b7d8..e5018742 100644 --- a/tests/keyboard/parseKeyDef.ts +++ b/tests/keyboard/parseKeyDef.ts @@ -44,18 +44,18 @@ cases( }, '{ as printable': { text: '{{', - keyDef: {key: '{', code: 'Unknown'}, + keyDef: {key: '{', code: 'BracketLeft', shiftKey: true}, }, '{ as printable followed by descriptor': { text: '{{{foo}', keyDef: [ - {key: '{', code: 'Unknown'}, + {key: '{', code: 'BracketLeft', shiftKey: true}, {key: 'foo', code: 'Unknown'}, ], }, '{ as key with modifiers': { text: '{\\{>5/}', - keyDef: {key: '{', code: 'Unknown'}, + keyDef: {key: '{', code: 'BracketLeft', shiftKey: true}, }, 'modifier as key with modifiers': { text: '{/\\/>5/}', @@ -63,7 +63,7 @@ cases( }, '[ as printable': { text: '[[', - keyDef: {key: '[', code: 'Unknown'}, + keyDef: {key: '[', code: 'BracketLeft'}, }, }, )