|
4 | 4 | *--------------------------------------------------------------------------------------------*/
|
5 | 5 |
|
6 | 6 | import * as dom from 'vs/base/browser/dom';
|
| 7 | +import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; |
7 | 8 | import { Action, IAction, Separator, SubmenuAction } from 'vs/base/common/actions';
|
8 | 9 | import { equals } from 'vs/base/common/arrays';
|
9 | 10 | import { RunOnceScheduler } from 'vs/base/common/async';
|
@@ -456,11 +457,24 @@ export class TestingDecorations extends Disposable implements IEditorContributio
|
456 | 457 | decorations.syncDecorations(this._currentUri);
|
457 | 458 | }
|
458 | 459 | }));
|
459 |
| - this._register(this.editor.onKeyDown(e => { |
460 |
| - if (e.keyCode === KeyCode.Alt && this._currentUri) { |
461 |
| - decorations.updateDecorationsAlternateAction(this._currentUri!, true); |
| 460 | + |
| 461 | + const win = dom.getWindow(editor.getDomNode()); |
| 462 | + this._register(dom.addDisposableListener(win, 'keydown', e => { |
| 463 | + if (new StandardKeyboardEvent(e).keyCode === KeyCode.Alt && this._currentUri) { |
| 464 | + decorations.updateDecorationsAlternateAction(this._currentUri, true); |
| 465 | + } |
| 466 | + })); |
| 467 | + this._register(dom.addDisposableListener(win, 'keyup', e => { |
| 468 | + if (new StandardKeyboardEvent(e).keyCode === KeyCode.Alt && this._currentUri) { |
| 469 | + decorations.updateDecorationsAlternateAction(this._currentUri, false); |
462 | 470 | }
|
463 | 471 | }));
|
| 472 | + this._register(dom.addDisposableListener(win, 'blur', () => { |
| 473 | + if (this._currentUri) { |
| 474 | + decorations.updateDecorationsAlternateAction(this._currentUri, false); |
| 475 | + } |
| 476 | + })); |
| 477 | + |
464 | 478 | this._register(this.editor.onKeyUp(e => {
|
465 | 479 | if (e.keyCode === KeyCode.Alt && this._currentUri) {
|
466 | 480 | decorations.updateDecorationsAlternateAction(this._currentUri!, false);
|
|
0 commit comments