Skip to content

Commit

Permalink
fix(core-browser): accelerator string can only contain ASCII characte…
Browse files Browse the repository at this point in the history
…rs (#2017)
  • Loading branch information
BlackHole1 authored Nov 29, 2022
1 parent edf4056 commit 8d0e866
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ describe('KeyboardLayoutService should be work', () => {
);
const disposable = keyboardLayoutService.onKeyboardLayoutChanged(() => {
const toggleComment = keyboardLayoutService.resolveKeyCode(KeyCode.createKeyCode('Slash+M1'));
expect(toggleComment.toString()).toBe(`${isOSX ? '' : 'Ctrl'}+/`);
expect(toggleComment.toString()).toBe(`${isOSX ? 'Cmd' : 'Ctrl'}+/`);
expect(keyboardLayoutService.getKeyboardCharacter(toggleComment.key!)).toBe('/');
const indentLine = keyboardLayoutService.resolveKeyCode(KeyCode.createKeyCode('BracketRight+M1'));
expect(indentLine.toString()).toBe(`${isOSX ? '' : 'Ctrl'}+]`);
expect(indentLine.toString()).toBe(`${isOSX ? 'Cmd' : 'Ctrl'}+]`);
expect(keyboardLayoutService.getKeyboardCharacter(indentLine.key!)).toBe(']');
disposable.dispose();
done();
Expand Down
2 changes: 1 addition & 1 deletion packages/core-browser/src/keyboard/keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export class KeyCode {
public toString(): string {
const result: string[] = [];
if (this.meta) {
result.push(isOSX ? '' : 'Win');
result.push(isOSX ? 'Cmd' : 'Win');
}
if (this.shift) {
result.push(toNormalCase(Key.SHIFT_LEFT.easyString));
Expand Down

0 comments on commit 8d0e866

Please sign in to comment.