diff --git a/src/Terminal.ts b/src/Terminal.ts index 7a068c84..952adb01 100644 --- a/src/Terminal.ts +++ b/src/Terminal.ts @@ -179,6 +179,13 @@ export class Terminal extends Disposable implements ITerminal, IDisposable, IInp // Store if user went browsing history in scrollback private _userScrolling: boolean; + /** + * Records whether the keydown event has already been handled and triggered a data event, if so + * the keypress event should not trigger a data event but should still print to the textarea so + * screen readers will announce it. + */ + private _keyDownHandled: boolean = false; + private _inputHandler: InputHandler; public linkifier: ILinkifier; public viewport: IViewport; @@ -246,13 +253,13 @@ export class Terminal extends Disposable implements ITerminal, IDisposable, IInp this._instantiationService.setService(IOptionsService, this.optionsService); this._bufferService = this._instantiationService.createInstance(BufferService); this._instantiationService.setService(IBufferService, this._bufferService); + this._logService = this._instantiationService.createInstance(LogService); + this._instantiationService.setService(ILogService, this._logService); this._coreService = this._instantiationService.createInstance(CoreService, () => this.scrollToBottom()); this._instantiationService.setService(ICoreService, this._coreService); this._coreService.onData(e => this._onData.fire(e)); this._dirtyRowService = this._instantiationService.createInstance(DirtyRowService); this._instantiationService.setService(IDirtyRowService, this._dirtyRowService); - this._logService = this._instantiationService.createInstance(LogService); - this._instantiationService.setService(ILogService, this._logService); this._setupOptionsListeners(); this._setup(); @@ -1515,6 +1522,8 @@ export class Terminal extends Disposable implements ITerminal, IDisposable, IInp * @param ev The keydown event to be handled. */ protected _keyDown(event: KeyboardEvent): boolean { + this._keyDownHandled = false; + if (this._customKeyEventHandler && this._customKeyEventHandler(event) === false) { return false; } @@ -1530,12 +1539,6 @@ export class Terminal extends Disposable implements ITerminal, IDisposable, IInp this.updateCursorStyle(event); - // if (result.key === C0.DC3) { // XOFF - // this._writeStopped = true; - // } else if (result.key === C0.DC1) { // XON - // this._writeStopped = false; - // } - if (result.type === KeyboardResultType.PAGE_DOWN || result.type === KeyboardResultType.PAGE_UP) { const scrollCount = this.rows - 1; this.scrollLines(result.type === KeyboardResultType.PAGE_UP ? -scrollCount : scrollCount); @@ -1559,11 +1562,17 @@ export class Terminal extends Disposable implements ITerminal, IDisposable, IInp return true; } + // If ctrl+c or enter is being sent, clear out the textarea. This is done so that screen readers + // will announce deleted characters. This will not work 100% of the time but it should cover + // most scenarios. + if (result.key === C0.ETX || result.key === C0.CR) { + this.textarea.value = ''; + } + + this._keyDownHandled = true; this._onKey.fire({ key: result.key, domEvent: event }); this.showCursor(); this._coreService.triggerDataEvent(result.key, true); - - return this.cancel(event, true); } private _isThirdLevelShift(browser: IBrowser, ev: IKeyboardEvent): boolean { @@ -1621,6 +1630,10 @@ export class Terminal extends Disposable implements ITerminal, IDisposable, IInp protected _keyPress(ev: KeyboardEvent): boolean { let key; + if (this._keyDownHandled) { + return false; + } + if (this._customKeyEventHandler && this._customKeyEventHandler(ev) === false) { return false; } diff --git a/src/common/services/CoreService.ts b/src/common/services/CoreService.ts index 674cfedb..d17b0c93 100644 --- a/src/common/services/CoreService.ts +++ b/src/common/services/CoreService.ts @@ -3,7 +3,7 @@ * @license MIT */ -import { ICoreService, IOptionsService, IBufferService } from 'common/services/Services'; +import { ICoreService, ILogService, IOptionsService, IBufferService } from 'common/services/Services'; import { EventEmitter, IEvent } from 'common/EventEmitter'; import { IDecPrivateModes } from 'common/Types'; import { clone } from 'common/Clone'; @@ -26,6 +26,7 @@ export class CoreService implements ICoreService { // TODO: Move this into a service private readonly _scrollToBottom: () => void, @IBufferService private readonly _bufferService: IBufferService, + @ILogService private readonly _logService: ILogService, @IOptionsService private readonly _optionsService: IOptionsService ) { this.decPrivateModes = clone(DEFAULT_DEC_PRIVATE_MODES); @@ -53,6 +54,7 @@ export class CoreService implements ICoreService { } // Fire onData API + this._logService.debug('sending data', data); this._onData.fire(data); } } diff --git a/test/api/MouseTracking.api.ts b/test/api/MouseTracking.api.ts index 59f65b6a..8c84384e 100644 --- a/test/api/MouseTracking.api.ts +++ b/test/api/MouseTracking.api.ts @@ -78,10 +78,10 @@ async function mouseClick(col: number, row: number): Promise { const [xPixels, yPixels] = await cellPos(col, row); return await page.mouse.click(xPixels, yPixels); } -async function mouseDown(button: "left" | "right" | "middle" | undefined): Promise { +async function mouseDown(button: 'left' | 'right' | 'middle' | undefined): Promise { return await page.mouse.down({button}); } -async function mouseUp(button: "left" | "right" | "middle" | undefined): Promise { +async function mouseUp(button: 'left' | 'right' | 'middle' | undefined): Promise { return await page.mouse.up({button}); } async function wheelUp(): Promise { @@ -115,15 +115,15 @@ const buttons: {[key: string]: number} = { aux12: 12, aux13: 13, aux14: 14, - aux15: 15, -} + aux15: 15 +}; const reverseButtons: any = {}; -for (let el in buttons) { +for (const el in buttons) { reverseButtons[buttons[el]] = el; } // extract button data from buttonCode -function evalButtonCode(code: number) : any { +function evalButtonCode(code: number): any { const modifier = {shift: !!(code & 4), meta: !!(code & 8), control: !!(code & 16)}; const move = code & 32; let button = 0; @@ -156,7 +156,7 @@ function evalButtonCode(code: number) : any { } // parse a single mouse report -function parseReport(encoding: string, msg: number[]): {state: any; row: number; col: number;} | string { +function parseReport(encoding: string, msg: number[]): {state: any; row: number; col: number; } | string { let sReport: string; let buttonCode: number; let row: number; @@ -256,7 +256,7 @@ describe('Mouse Tracking Tests', function(): void { // test at 0,0 await mouseDown('left'); assert.deepEqual(await getReports(encoding), [{col: 1, row: 1, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}]); - + // mouseup should not report await mouseUp('left'); assert.deepEqual(await getReports(encoding), []); @@ -267,7 +267,7 @@ describe('Mouse Tracking Tests', function(): void { await mouseDown('left'); await mouseUp('left'); assert.deepEqual(await getReports(encoding), [{col: 51, row: 11, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}]); - + // test at max rows/cols // bug: we are capped at col 95 currently // fix: allow values up to 223, any bigger should drop to 0 @@ -300,7 +300,7 @@ describe('Mouse Tracking Tests', function(): void { await mouseMove(44, 24); await mouseUp('right'); assert.deepEqual(await getReports(encoding), [{col: 44, row: 25, state: {action: 'press', button: 'right', modifier: {control: false, shift: false, meta: false}}}]); - + // wheel await mouseMove(43, 24); await getReports(encoding); // clear reports @@ -320,8 +320,8 @@ describe('Mouse Tracking Tests', function(): void { await wheelDown(); await page.keyboard.up('Control'); assert.deepEqual(await getReports(encoding), [{col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}]); - - + + // ALT await mouseMove(43, 24); await getReports(encoding); // clear reports @@ -332,7 +332,7 @@ describe('Mouse Tracking Tests', function(): void { await wheelDown(); await page.keyboard.up('Alt'); assert.deepEqual(await getReports(encoding), [{col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}]); - + // SHIFT // note: caught by selection manager // bug? Why not caught by selection manger on macos? @@ -379,7 +379,7 @@ describe('Mouse Tracking Tests', function(): void { // test at 0,0 await mouseDown('left'); assert.deepEqual(await getReports(encoding), [{col: 1, row: 1, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}]); - + // mouseup should not report await mouseUp('left'); assert.deepEqual(await getReports(encoding), []); @@ -390,7 +390,7 @@ describe('Mouse Tracking Tests', function(): void { await mouseDown('left'); await mouseUp('left'); assert.deepEqual(await getReports(encoding), [{col: 51, row: 11, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}]); - + // test at max rows/cols await mouseMove(cols - 1, rows - 1); await mouseDown('left'); @@ -421,7 +421,7 @@ describe('Mouse Tracking Tests', function(): void { await mouseMove(44, 24); await mouseUp('right'); assert.deepEqual(await getReports(encoding), [{col: 44, row: 25, state: {action: 'press', button: 'right', modifier: {control: false, shift: false, meta: false}}}]); - + // wheel await mouseMove(43, 24); await getReports(encoding); // clear reports @@ -429,7 +429,7 @@ describe('Mouse Tracking Tests', function(): void { assert.deepEqual(await getReports(encoding), []); await wheelDown(); assert.deepEqual(await getReports(encoding), []); - + // modifiers // CTRL await mouseMove(43, 24); @@ -441,8 +441,8 @@ describe('Mouse Tracking Tests', function(): void { await wheelDown(); await page.keyboard.up('Control'); assert.deepEqual(await getReports(encoding), [{col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}]); - - + + // ALT await mouseMove(43, 24); await getReports(encoding); // clear reports @@ -453,7 +453,7 @@ describe('Mouse Tracking Tests', function(): void { await wheelDown(); await page.keyboard.up('Alt'); assert.deepEqual(await getReports(encoding), [{col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}]); - + // SHIFT // note: caught by selection manager await mouseMove(43, 24); @@ -498,7 +498,7 @@ describe('Mouse Tracking Tests', function(): void { // test at 0,0 await mouseDown('left'); assert.deepEqual(await getReports(encoding), [{col: 1, row: 1, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}]); - + // mouseup should not report await mouseUp('left'); assert.deepEqual(await getReports(encoding), []); @@ -509,7 +509,7 @@ describe('Mouse Tracking Tests', function(): void { await mouseDown('left'); await mouseUp('left'); assert.deepEqual(await getReports(encoding), [{col: 51, row: 11, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}]); - + // test at max rows/cols await mouseMove(cols - 1, rows - 1); await mouseDown('left'); @@ -540,7 +540,7 @@ describe('Mouse Tracking Tests', function(): void { await mouseMove(44, 24); await mouseUp('right'); assert.deepEqual(await getReports(encoding), [{col: 44, row: 25, state: {action: 'press', button: 'right', modifier: {control: false, shift: false, meta: false}}}]); - + // wheel await mouseMove(43, 24); await getReports(encoding); // clear reports @@ -560,8 +560,8 @@ describe('Mouse Tracking Tests', function(): void { await wheelDown(); await page.keyboard.up('Control'); assert.deepEqual(await getReports(encoding), [{col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}]); - - + + // ALT await mouseMove(43, 24); await getReports(encoding); // clear reports @@ -572,7 +572,7 @@ describe('Mouse Tracking Tests', function(): void { await wheelDown(); await page.keyboard.up('Alt'); assert.deepEqual(await getReports(encoding), [{col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}]); - + // SHIFT // note: caught by selection manager await mouseMove(43, 24); @@ -618,7 +618,7 @@ describe('Mouse Tracking Tests', function(): void { // test at 0,0 await mouseDown('left'); assert.deepEqual(await getReports(encoding), [{col: 1, row: 1, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}]); - + // mouseup should not report await mouseUp('left'); assert.deepEqual(await getReports(encoding), []); @@ -629,7 +629,7 @@ describe('Mouse Tracking Tests', function(): void { await mouseDown('left'); await mouseUp('left'); assert.deepEqual(await getReports(encoding), [{col: 51, row: 11, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}]); - + // test at max rows/cols await mouseMove(cols - 1, rows - 1); await mouseDown('left'); @@ -660,7 +660,7 @@ describe('Mouse Tracking Tests', function(): void { await mouseMove(44, 24); await mouseUp('right'); assert.deepEqual(await getReports(encoding), [{col: 44, row: 25, state: {action: 'press', button: 'right', modifier: {control: false, shift: false, meta: false}}}]); - + // wheel await mouseMove(43, 24); await getReports(encoding); // clear reports @@ -680,8 +680,8 @@ describe('Mouse Tracking Tests', function(): void { await wheelDown(); await page.keyboard.up('Control'); assert.deepEqual(await getReports(encoding), [{col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}]); - - + + // ALT await mouseMove(43, 24); await getReports(encoding); // clear reports @@ -692,7 +692,7 @@ describe('Mouse Tracking Tests', function(): void { await wheelDown(); await page.keyboard.up('Alt'); assert.deepEqual(await getReports(encoding), [{col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}]); - + // SHIFT // note: caught by selection manager await mouseMove(43, 24); @@ -750,7 +750,7 @@ describe('Mouse Tracking Tests', function(): void { {col: 1, row: 1, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}, {col: 1, row: 1, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}} ]); - + // mouseup should report, encoding cannot report released button // bug: release already fired thus no event here - expected: release event await mouseUp('left'); @@ -763,9 +763,9 @@ describe('Mouse Tracking Tests', function(): void { await mouseUp('left'); assert.deepEqual(await getReports(encoding), [ {col: 51, row: 11, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}, - {col: 51, row: 11, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}}, + {col: 51, row: 11, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}} ]); - + // test at max rows/cols // bug: we are capped at col 95 currently // fix: allow values up to 223, any bigger should drop to 0 @@ -774,7 +774,7 @@ describe('Mouse Tracking Tests', function(): void { await mouseUp('left'); assert.deepEqual(await getReports(encoding), [ {col: 95, row: rows, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}, - {col: 95, row: rows, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}}, + {col: 95, row: rows, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}} ]); // button press/move/release tests @@ -787,7 +787,7 @@ describe('Mouse Tracking Tests', function(): void { await mouseUp('left'); assert.deepEqual(await getReports(encoding), [ {col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}, - {col: 44, row: 25, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}}, + {col: 44, row: 25, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}} ]); // middle button // bug: default action not cancelled (adds data to getReports from clipboard under X11) @@ -807,9 +807,9 @@ describe('Mouse Tracking Tests', function(): void { await mouseUp('right'); assert.deepEqual(await getReports(encoding), [ {col: 44, row: 25, state: {action: 'press', button: 'right', modifier: {control: false, shift: false, meta: false}}}, - {col: 44, row: 25, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}}, + {col: 44, row: 25, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}} ]); - + // wheel await mouseMove(43, 24); await getReports(encoding); // clear reports @@ -839,7 +839,7 @@ describe('Mouse Tracking Tests', function(): void { // {col: 45, row: 25, state: {action: 'release', button: '', modifier: {control: true, shift: false, meta: false}}}, // {col: 45, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: true, shift: false, meta: false}}} ]); - + // ALT // bug: no modifier reported, release with wrong coords await mouseMove(43, 24); @@ -859,7 +859,7 @@ describe('Mouse Tracking Tests', function(): void { // {col: 45, row: 25, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: true}}}, // {col: 45, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: false, shift: false, meta: true}}} ]); - + // SHIFT // note: press/release caught by selection manager // bug: modifier not reported for passed events @@ -910,7 +910,7 @@ describe('Mouse Tracking Tests', function(): void { {col: 1, row: 1, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}, {col: 1, row: 1, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}} ]); - + // mouseup should report, encoding cannot report released button // bug: release already fired thus no event here - expected: release event await mouseUp('left'); @@ -923,16 +923,16 @@ describe('Mouse Tracking Tests', function(): void { await mouseUp('left'); assert.deepEqual(await getReports(encoding), [ {col: 51, row: 11, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}, - {col: 51, row: 11, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}}, + {col: 51, row: 11, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}} ]); - + // test at max rows/cols await mouseMove(cols - 1, rows - 1); await mouseDown('left'); await mouseUp('left'); assert.deepEqual(await getReports(encoding), [ {col: cols, row: rows, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}, - {col: cols, row: rows, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}}, + {col: cols, row: rows, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}} ]); // button press/move/release tests @@ -945,7 +945,7 @@ describe('Mouse Tracking Tests', function(): void { await mouseUp('left'); assert.deepEqual(await getReports(encoding), [ {col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}, - {col: 44, row: 25, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}}, + {col: 44, row: 25, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}} ]); // middle button // bug: default action not cancelled (adds data to getReports from clipboard under X11) @@ -965,9 +965,9 @@ describe('Mouse Tracking Tests', function(): void { await mouseUp('right'); assert.deepEqual(await getReports(encoding), [ {col: 44, row: 25, state: {action: 'press', button: 'right', modifier: {control: false, shift: false, meta: false}}}, - {col: 44, row: 25, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}}, + {col: 44, row: 25, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}} ]); - + // wheel await mouseMove(43, 24); await getReports(encoding); // clear reports @@ -997,7 +997,7 @@ describe('Mouse Tracking Tests', function(): void { // {col: 45, row: 25, state: {action: 'release', button: '', modifier: {control: true, shift: false, meta: false}}}, // {col: 45, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: true, shift: false, meta: false}}} ]); - + // ALT // bug: no modifier reported, release with wrong coords await mouseMove(43, 24); @@ -1017,7 +1017,7 @@ describe('Mouse Tracking Tests', function(): void { // {col: 45, row: 25, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: true}}}, // {col: 45, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: false, shift: false, meta: true}}} ]); - + // SHIFT // note: press/release caught by selection manager // bug: modifier not reported for passed events @@ -1068,7 +1068,7 @@ describe('Mouse Tracking Tests', function(): void { {col: 1, row: 1, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}, {col: 1, row: 1, state: {action: 'release', button: 'left', modifier: {control: false, shift: false, meta: false}}} ]); - + // mouseup should report // bug: release already fired thus no event here - expected: release event await mouseUp('left'); @@ -1081,16 +1081,16 @@ describe('Mouse Tracking Tests', function(): void { await mouseUp('left'); assert.deepEqual(await getReports(encoding), [ {col: 51, row: 11, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}, - {col: 51, row: 11, state: {action: 'release', button: 'left', modifier: {control: false, shift: false, meta: false}}}, + {col: 51, row: 11, state: {action: 'release', button: 'left', modifier: {control: false, shift: false, meta: false}}} ]); - + // test at max rows/cols await mouseMove(cols - 1, rows - 1); await mouseDown('left'); await mouseUp('left'); assert.deepEqual(await getReports(encoding), [ {col: cols, row: rows, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}, - {col: cols, row: rows, state: {action: 'release', button: 'left', modifier: {control: false, shift: false, meta: false}}}, + {col: cols, row: rows, state: {action: 'release', button: 'left', modifier: {control: false, shift: false, meta: false}}} ]); // button press/move/release tests @@ -1103,7 +1103,7 @@ describe('Mouse Tracking Tests', function(): void { await mouseUp('left'); assert.deepEqual(await getReports(encoding), [ {col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}, - {col: 44, row: 25, state: {action: 'release', button: 'left', modifier: {control: false, shift: false, meta: false}}}, + {col: 44, row: 25, state: {action: 'release', button: 'left', modifier: {control: false, shift: false, meta: false}}} ]); // middle button // bug: default action not cancelled (adds data to getReports from clipboard under X11) @@ -1124,9 +1124,9 @@ describe('Mouse Tracking Tests', function(): void { await mouseUp('right'); assert.deepEqual(await getReports(encoding), [ {col: 44, row: 25, state: {action: 'press', button: 'right', modifier: {control: false, shift: false, meta: false}}}, - {col: 44, row: 25, state: {action: 'release', button: 'left', modifier: {control: false, shift: false, meta: false}}}, + {col: 44, row: 25, state: {action: 'release', button: 'left', modifier: {control: false, shift: false, meta: false}}} ]); - + // wheel await mouseMove(43, 24); await getReports(encoding); // clear reports @@ -1156,7 +1156,7 @@ describe('Mouse Tracking Tests', function(): void { // {col: 45, row: 25, state: {action: 'release', button: '', modifier: {control: true, shift: false, meta: false}}}, // {col: 45, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: true, shift: false, meta: false}}} ]); - + // ALT // bug: no modifier reported, release with wrong coords await mouseMove(43, 24); @@ -1176,7 +1176,7 @@ describe('Mouse Tracking Tests', function(): void { // {col: 45, row: 25, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: true}}}, // {col: 45, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: false, shift: false, meta: true}}} ]); - + // SHIFT // note: press/release caught by selection manager // bug: modifier not reported for passed events @@ -1227,7 +1227,7 @@ describe('Mouse Tracking Tests', function(): void { {col: 1, row: 1, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}, {col: 1, row: 1, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}} ]); - + // mouseup should report, encoding cannot report released button // bug: release already fired thus no event here - expected: release event await mouseUp('left'); @@ -1240,16 +1240,16 @@ describe('Mouse Tracking Tests', function(): void { await mouseUp('left'); assert.deepEqual(await getReports(encoding), [ {col: 51, row: 11, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}, - {col: 51, row: 11, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}}, + {col: 51, row: 11, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}} ]); - + // test at max rows/cols await mouseMove(cols - 1, rows - 1); await mouseDown('left'); await mouseUp('left'); assert.deepEqual(await getReports(encoding), [ {col: cols, row: rows, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}, - {col: cols, row: rows, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}}, + {col: cols, row: rows, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}} ]); // button press/move/release tests @@ -1262,7 +1262,7 @@ describe('Mouse Tracking Tests', function(): void { await mouseUp('left'); assert.deepEqual(await getReports(encoding), [ {col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}, - {col: 44, row: 25, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}}, + {col: 44, row: 25, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}} ]); // middle button // bug: default action not cancelled (adds data to getReports from clipboard under X11) @@ -1282,9 +1282,9 @@ describe('Mouse Tracking Tests', function(): void { await mouseUp('right'); assert.deepEqual(await getReports(encoding), [ {col: 44, row: 25, state: {action: 'press', button: 'right', modifier: {control: false, shift: false, meta: false}}}, - {col: 44, row: 25, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}}, + {col: 44, row: 25, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}} ]); - + // wheel await mouseMove(43, 24); await getReports(encoding); // clear reports @@ -1314,7 +1314,7 @@ describe('Mouse Tracking Tests', function(): void { // {col: 45, row: 25, state: {action: 'release', button: '', modifier: {control: true, shift: false, meta: false}}}, // {col: 45, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: true, shift: false, meta: false}}} ]); - + // ALT // bug: no modifier reported, release with wrong coords await mouseMove(43, 24); @@ -1334,7 +1334,7 @@ describe('Mouse Tracking Tests', function(): void { // {col: 45, row: 25, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: true}}}, // {col: 45, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: false, shift: false, meta: true}}} ]); - + // SHIFT // note: press/release caught by selection manager // bug: modifier not reported for passed events @@ -1393,7 +1393,7 @@ describe('Mouse Tracking Tests', function(): void { assert.deepEqual(await getReports(encoding), [ {col: 1, row: 1, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}} ]); - + // mouseup should report, encoding cannot report released button await mouseUp('left'); assert.deepEqual(await getReports(encoding), [ @@ -1407,9 +1407,9 @@ describe('Mouse Tracking Tests', function(): void { await mouseUp('left'); assert.deepEqual(await getReports(encoding), [ {col: 51, row: 11, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}, - {col: 51, row: 11, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}}, + {col: 51, row: 11, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}} ]); - + // test at max rows/cols // bug: we are capped at col 95 currently // fix: allow values up to 223, any bigger should drop to 0 @@ -1418,7 +1418,7 @@ describe('Mouse Tracking Tests', function(): void { await mouseUp('left'); assert.deepEqual(await getReports(encoding), [ {col: 95, row: rows, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}, - {col: 95, row: rows, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}}, + {col: 95, row: rows, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}} ]); // button press/move/release tests @@ -1431,7 +1431,7 @@ describe('Mouse Tracking Tests', function(): void { assert.deepEqual(await getReports(encoding), [ {col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}, {col: 45, row: 25, state: {action: 'move', button: 'left', modifier: {control: false, shift: false, meta: false}}}, - {col: 45, row: 25, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}}, + {col: 45, row: 25, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}} ]); // middle button // bug: default action not cancelled (adds data to getReports from clipboard under X11) @@ -1451,9 +1451,9 @@ describe('Mouse Tracking Tests', function(): void { assert.deepEqual(await getReports(encoding), [ {col: 44, row: 25, state: {action: 'press', button: 'right', modifier: {control: false, shift: false, meta: false}}}, {col: 45, row: 25, state: {action: 'move', button: 'right', modifier: {control: false, shift: false, meta: false}}}, - {col: 45, row: 25, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}}, + {col: 45, row: 25, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}} ]); - + // wheel await mouseMove(43, 24); await getReports(encoding); // clear reports @@ -1485,7 +1485,7 @@ describe('Mouse Tracking Tests', function(): void { // {col: 45, row: 25, state: {action: 'release', button: '', modifier: {control: true, shift: false, meta: false}}}, // {col: 45, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: true, shift: false, meta: false}}} ]); - + // ALT // bug: no modifier reported await mouseMove(43, 24); @@ -1507,7 +1507,7 @@ describe('Mouse Tracking Tests', function(): void { // {col: 45, row: 25, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: true}}}, // {col: 45, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: false, shift: false, meta: true}}} ]); - + // SHIFT // note: press/release/drag caught by selection manager // bug: modifier not reported for passed events @@ -1558,7 +1558,7 @@ describe('Mouse Tracking Tests', function(): void { assert.deepEqual(await getReports(encoding), [ {col: 1, row: 1, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}} ]); - + // mouseup should report, encoding cannot report released button // bug: release already fired thus no event here - expected: release event await mouseUp('left'); @@ -1573,16 +1573,16 @@ describe('Mouse Tracking Tests', function(): void { await mouseUp('left'); assert.deepEqual(await getReports(encoding), [ {col: 51, row: 11, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}, - {col: 51, row: 11, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}}, + {col: 51, row: 11, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}} ]); - + // test at max rows/cols await mouseMove(cols - 1, rows - 1); await mouseDown('left'); await mouseUp('left'); assert.deepEqual(await getReports(encoding), [ {col: cols, row: rows, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}, - {col: cols, row: rows, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}}, + {col: cols, row: rows, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}} ]); // button press/move/release tests @@ -1595,7 +1595,7 @@ describe('Mouse Tracking Tests', function(): void { assert.deepEqual(await getReports(encoding), [ {col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}, {col: 45, row: 25, state: {action: 'move', button: 'left', modifier: {control: false, shift: false, meta: false}}}, - {col: 45, row: 25, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}}, + {col: 45, row: 25, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}} ]); // middle button // bug: default action not cancelled (adds data to getReports from clipboard under X11) @@ -1615,9 +1615,9 @@ describe('Mouse Tracking Tests', function(): void { assert.deepEqual(await getReports(encoding), [ {col: 44, row: 25, state: {action: 'press', button: 'right', modifier: {control: false, shift: false, meta: false}}}, {col: 45, row: 25, state: {action: 'move', button: 'right', modifier: {control: false, shift: false, meta: false}}}, - {col: 45, row: 25, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}}, + {col: 45, row: 25, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}} ]); - + // wheel await mouseMove(43, 24); await getReports(encoding); // clear reports @@ -1649,7 +1649,7 @@ describe('Mouse Tracking Tests', function(): void { // {col: 45, row: 25, state: {action: 'release', button: '', modifier: {control: true, shift: false, meta: false}}}, // {col: 45, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: true, shift: false, meta: false}}} ]); - + // ALT // bug: no modifier reported await mouseMove(43, 24); @@ -1671,7 +1671,7 @@ describe('Mouse Tracking Tests', function(): void { // {col: 45, row: 25, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: true}}}, // {col: 45, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: false, shift: false, meta: true}}} ]); - + // SHIFT // note: press/release/drag caught by selection manager // bug: modifier not reported for passed events @@ -1722,7 +1722,7 @@ describe('Mouse Tracking Tests', function(): void { assert.deepEqual(await getReports(encoding), [ {col: 1, row: 1, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}} ]); - + // mouseup should report, encoding cannot report released button await mouseUp('left'); assert.deepEqual(await getReports(encoding), [ @@ -1736,16 +1736,16 @@ describe('Mouse Tracking Tests', function(): void { await mouseUp('left'); assert.deepEqual(await getReports(encoding), [ {col: 51, row: 11, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}, - {col: 51, row: 11, state: {action: 'release', button: 'left', modifier: {control: false, shift: false, meta: false}}}, + {col: 51, row: 11, state: {action: 'release', button: 'left', modifier: {control: false, shift: false, meta: false}}} ]); - + // test at max rows/cols await mouseMove(cols - 1, rows - 1); await mouseDown('left'); await mouseUp('left'); assert.deepEqual(await getReports(encoding), [ {col: cols, row: rows, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}, - {col: cols, row: rows, state: {action: 'release', button: 'left', modifier: {control: false, shift: false, meta: false}}}, + {col: cols, row: rows, state: {action: 'release', button: 'left', modifier: {control: false, shift: false, meta: false}}} ]); // button press/move/release tests @@ -1758,7 +1758,7 @@ describe('Mouse Tracking Tests', function(): void { assert.deepEqual(await getReports(encoding), [ {col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}, {col: 45, row: 25, state: {action: 'move', button: 'left', modifier: {control: false, shift: false, meta: false}}}, - {col: 45, row: 25, state: {action: 'release', button: 'left', modifier: {control: false, shift: false, meta: false}}}, + {col: 45, row: 25, state: {action: 'release', button: 'left', modifier: {control: false, shift: false, meta: false}}} ]); // middle button // bug: default action not cancelled (adds data to getReports from clipboard under X11) @@ -1779,9 +1779,9 @@ describe('Mouse Tracking Tests', function(): void { assert.deepEqual(await getReports(encoding), [ {col: 44, row: 25, state: {action: 'press', button: 'right', modifier: {control: false, shift: false, meta: false}}}, {col: 45, row: 25, state: {action: 'move', button: 'right', modifier: {control: false, shift: false, meta: false}}}, - {col: 45, row: 25, state: {action: 'release', button: 'left', modifier: {control: false, shift: false, meta: false}}}, + {col: 45, row: 25, state: {action: 'release', button: 'left', modifier: {control: false, shift: false, meta: false}}} ]); - + // wheel await mouseMove(43, 24); await getReports(encoding); // clear reports @@ -1813,7 +1813,7 @@ describe('Mouse Tracking Tests', function(): void { // {col: 45, row: 25, state: {action: 'release', button: 'left', modifier: {control: true, shift: false, meta: false}}}, // {col: 45, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: true, shift: false, meta: false}}} ]); - + // ALT // bug: no modifier reported await mouseMove(43, 24); @@ -1835,7 +1835,7 @@ describe('Mouse Tracking Tests', function(): void { // {col: 45, row: 25, state: {action: 'release', button: 'left', modifier: {control: false, shift: false, meta: true}}}, // {col: 45, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: false, shift: false, meta: true}}} ]); - + // SHIFT // note: press/release/drag caught by selection manager // bug: modifier not reported for passed events @@ -1886,7 +1886,7 @@ describe('Mouse Tracking Tests', function(): void { assert.deepEqual(await getReports(encoding), [ {col: 1, row: 1, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}} ]); - + // mouseup should report, encoding cannot report released button await mouseUp('left'); assert.deepEqual(await getReports(encoding), [ @@ -1900,16 +1900,16 @@ describe('Mouse Tracking Tests', function(): void { await mouseUp('left'); assert.deepEqual(await getReports(encoding), [ {col: 51, row: 11, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}, - {col: 51, row: 11, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}}, + {col: 51, row: 11, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}} ]); - + // test at max rows/cols await mouseMove(cols - 1, rows - 1); await mouseDown('left'); await mouseUp('left'); assert.deepEqual(await getReports(encoding), [ {col: cols, row: rows, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}, - {col: cols, row: rows, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}}, + {col: cols, row: rows, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}} ]); // button press/move/release tests @@ -1922,7 +1922,7 @@ describe('Mouse Tracking Tests', function(): void { assert.deepEqual(await getReports(encoding), [ {col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}, {col: 45, row: 25, state: {action: 'move', button: 'left', modifier: {control: false, shift: false, meta: false}}}, - {col: 45, row: 25, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}}, + {col: 45, row: 25, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}} ]); // middle button // bug: default action not cancelled (adds data to getReports from clipboard under X11) @@ -1942,9 +1942,9 @@ describe('Mouse Tracking Tests', function(): void { assert.deepEqual(await getReports(encoding), [ {col: 44, row: 25, state: {action: 'press', button: 'right', modifier: {control: false, shift: false, meta: false}}}, {col: 45, row: 25, state: {action: 'move', button: 'right', modifier: {control: false, shift: false, meta: false}}}, - {col: 45, row: 25, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}}, + {col: 45, row: 25, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}} ]); - + // wheel await mouseMove(43, 24); await getReports(encoding); // clear reports @@ -1976,7 +1976,7 @@ describe('Mouse Tracking Tests', function(): void { // {col: 45, row: 25, state: {action: 'release', button: '', modifier: {control: true, shift: false, meta: false}}}, // {col: 45, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: true, shift: false, meta: false}}} ]); - + // ALT // bug: no modifier reported await mouseMove(43, 24); @@ -1998,7 +1998,7 @@ describe('Mouse Tracking Tests', function(): void { // {col: 45, row: 25, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: true}}}, // {col: 45, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: false, shift: false, meta: true}}} ]); - + // SHIFT // note: press/release/drag caught by selection manager // bug: modifier not reported for passed events