Merge branch 'mouse_report_tests' of github.com:jerch/xterm.js into mouse_report_tests
This commit is contained in:
+23
-10
@@ -179,6 +179,13 @@ export class Terminal extends Disposable implements ITerminal, IDisposable, IInp
|
|||||||
// Store if user went browsing history in scrollback
|
// Store if user went browsing history in scrollback
|
||||||
private _userScrolling: boolean;
|
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;
|
private _inputHandler: InputHandler;
|
||||||
public linkifier: ILinkifier;
|
public linkifier: ILinkifier;
|
||||||
public viewport: IViewport;
|
public viewport: IViewport;
|
||||||
@@ -246,13 +253,13 @@ export class Terminal extends Disposable implements ITerminal, IDisposable, IInp
|
|||||||
this._instantiationService.setService(IOptionsService, this.optionsService);
|
this._instantiationService.setService(IOptionsService, this.optionsService);
|
||||||
this._bufferService = this._instantiationService.createInstance(BufferService);
|
this._bufferService = this._instantiationService.createInstance(BufferService);
|
||||||
this._instantiationService.setService(IBufferService, this._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._coreService = this._instantiationService.createInstance(CoreService, () => this.scrollToBottom());
|
||||||
this._instantiationService.setService(ICoreService, this._coreService);
|
this._instantiationService.setService(ICoreService, this._coreService);
|
||||||
this._coreService.onData(e => this._onData.fire(e));
|
this._coreService.onData(e => this._onData.fire(e));
|
||||||
this._dirtyRowService = this._instantiationService.createInstance(DirtyRowService);
|
this._dirtyRowService = this._instantiationService.createInstance(DirtyRowService);
|
||||||
this._instantiationService.setService(IDirtyRowService, this._dirtyRowService);
|
this._instantiationService.setService(IDirtyRowService, this._dirtyRowService);
|
||||||
this._logService = this._instantiationService.createInstance(LogService);
|
|
||||||
this._instantiationService.setService(ILogService, this._logService);
|
|
||||||
|
|
||||||
this._setupOptionsListeners();
|
this._setupOptionsListeners();
|
||||||
this._setup();
|
this._setup();
|
||||||
@@ -1515,6 +1522,8 @@ export class Terminal extends Disposable implements ITerminal, IDisposable, IInp
|
|||||||
* @param ev The keydown event to be handled.
|
* @param ev The keydown event to be handled.
|
||||||
*/
|
*/
|
||||||
protected _keyDown(event: KeyboardEvent): boolean {
|
protected _keyDown(event: KeyboardEvent): boolean {
|
||||||
|
this._keyDownHandled = false;
|
||||||
|
|
||||||
if (this._customKeyEventHandler && this._customKeyEventHandler(event) === false) {
|
if (this._customKeyEventHandler && this._customKeyEventHandler(event) === false) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1530,12 +1539,6 @@ export class Terminal extends Disposable implements ITerminal, IDisposable, IInp
|
|||||||
|
|
||||||
this.updateCursorStyle(event);
|
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) {
|
if (result.type === KeyboardResultType.PAGE_DOWN || result.type === KeyboardResultType.PAGE_UP) {
|
||||||
const scrollCount = this.rows - 1;
|
const scrollCount = this.rows - 1;
|
||||||
this.scrollLines(result.type === KeyboardResultType.PAGE_UP ? -scrollCount : scrollCount);
|
this.scrollLines(result.type === KeyboardResultType.PAGE_UP ? -scrollCount : scrollCount);
|
||||||
@@ -1559,11 +1562,17 @@ export class Terminal extends Disposable implements ITerminal, IDisposable, IInp
|
|||||||
return true;
|
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._onKey.fire({ key: result.key, domEvent: event });
|
||||||
this.showCursor();
|
this.showCursor();
|
||||||
this._coreService.triggerDataEvent(result.key, true);
|
this._coreService.triggerDataEvent(result.key, true);
|
||||||
|
|
||||||
return this.cancel(event, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private _isThirdLevelShift(browser: IBrowser, ev: IKeyboardEvent): boolean {
|
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 {
|
protected _keyPress(ev: KeyboardEvent): boolean {
|
||||||
let key;
|
let key;
|
||||||
|
|
||||||
|
if (this._keyDownHandled) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (this._customKeyEventHandler && this._customKeyEventHandler(ev) === false) {
|
if (this._customKeyEventHandler && this._customKeyEventHandler(ev) === false) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
* @license MIT
|
* @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 { EventEmitter, IEvent } from 'common/EventEmitter';
|
||||||
import { IDecPrivateModes } from 'common/Types';
|
import { IDecPrivateModes } from 'common/Types';
|
||||||
import { clone } from 'common/Clone';
|
import { clone } from 'common/Clone';
|
||||||
@@ -26,6 +26,7 @@ export class CoreService implements ICoreService {
|
|||||||
// TODO: Move this into a service
|
// TODO: Move this into a service
|
||||||
private readonly _scrollToBottom: () => void,
|
private readonly _scrollToBottom: () => void,
|
||||||
@IBufferService private readonly _bufferService: IBufferService,
|
@IBufferService private readonly _bufferService: IBufferService,
|
||||||
|
@ILogService private readonly _logService: ILogService,
|
||||||
@IOptionsService private readonly _optionsService: IOptionsService
|
@IOptionsService private readonly _optionsService: IOptionsService
|
||||||
) {
|
) {
|
||||||
this.decPrivateModes = clone(DEFAULT_DEC_PRIVATE_MODES);
|
this.decPrivateModes = clone(DEFAULT_DEC_PRIVATE_MODES);
|
||||||
@@ -53,6 +54,7 @@ export class CoreService implements ICoreService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Fire onData API
|
// Fire onData API
|
||||||
|
this._logService.debug('sending data', data);
|
||||||
this._onData.fire(data);
|
this._onData.fire(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,10 +78,10 @@ async function mouseClick(col: number, row: number): Promise<void> {
|
|||||||
const [xPixels, yPixels] = await cellPos(col, row);
|
const [xPixels, yPixels] = await cellPos(col, row);
|
||||||
return await page.mouse.click(xPixels, yPixels);
|
return await page.mouse.click(xPixels, yPixels);
|
||||||
}
|
}
|
||||||
async function mouseDown(button: "left" | "right" | "middle" | undefined): Promise<void> {
|
async function mouseDown(button: 'left' | 'right' | 'middle' | undefined): Promise<void> {
|
||||||
return await page.mouse.down({button});
|
return await page.mouse.down({button});
|
||||||
}
|
}
|
||||||
async function mouseUp(button: "left" | "right" | "middle" | undefined): Promise<void> {
|
async function mouseUp(button: 'left' | 'right' | 'middle' | undefined): Promise<void> {
|
||||||
return await page.mouse.up({button});
|
return await page.mouse.up({button});
|
||||||
}
|
}
|
||||||
async function wheelUp(): Promise<void> {
|
async function wheelUp(): Promise<void> {
|
||||||
@@ -115,15 +115,15 @@ const buttons: {[key: string]: number} = {
|
|||||||
aux12: 12,
|
aux12: 12,
|
||||||
aux13: 13,
|
aux13: 13,
|
||||||
aux14: 14,
|
aux14: 14,
|
||||||
aux15: 15,
|
aux15: 15
|
||||||
}
|
};
|
||||||
const reverseButtons: any = {};
|
const reverseButtons: any = {};
|
||||||
for (let el in buttons) {
|
for (const el in buttons) {
|
||||||
reverseButtons[buttons[el]] = el;
|
reverseButtons[buttons[el]] = el;
|
||||||
}
|
}
|
||||||
|
|
||||||
// extract button data from buttonCode
|
// 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 modifier = {shift: !!(code & 4), meta: !!(code & 8), control: !!(code & 16)};
|
||||||
const move = code & 32;
|
const move = code & 32;
|
||||||
let button = 0;
|
let button = 0;
|
||||||
@@ -156,7 +156,7 @@ function evalButtonCode(code: number) : any {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// parse a single mouse report
|
// 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 sReport: string;
|
||||||
let buttonCode: number;
|
let buttonCode: number;
|
||||||
let row: number;
|
let row: number;
|
||||||
@@ -763,7 +763,7 @@ describe('Mouse Tracking Tests', function(): void {
|
|||||||
await mouseUp('left');
|
await mouseUp('left');
|
||||||
assert.deepEqual(await getReports(encoding), [
|
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: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}},
|
||||||
{col: 51, row: 11, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}},
|
{col: 51, row: 11, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// test at max rows/cols
|
// test at max rows/cols
|
||||||
@@ -774,7 +774,7 @@ describe('Mouse Tracking Tests', function(): void {
|
|||||||
await mouseUp('left');
|
await mouseUp('left');
|
||||||
assert.deepEqual(await getReports(encoding), [
|
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: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}},
|
||||||
{col: 95, row: rows, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}},
|
{col: 95, row: rows, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// button press/move/release tests
|
// button press/move/release tests
|
||||||
@@ -787,7 +787,7 @@ describe('Mouse Tracking Tests', function(): void {
|
|||||||
await mouseUp('left');
|
await mouseUp('left');
|
||||||
assert.deepEqual(await getReports(encoding), [
|
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: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}},
|
||||||
{col: 44, row: 25, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}},
|
{col: 44, row: 25, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}}
|
||||||
]);
|
]);
|
||||||
// middle button
|
// middle button
|
||||||
// bug: default action not cancelled (adds data to getReports from clipboard under X11)
|
// bug: default action not cancelled (adds data to getReports from clipboard under X11)
|
||||||
@@ -807,7 +807,7 @@ describe('Mouse Tracking Tests', function(): void {
|
|||||||
await mouseUp('right');
|
await mouseUp('right');
|
||||||
assert.deepEqual(await getReports(encoding), [
|
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: 'press', button: 'right', modifier: {control: false, shift: false, meta: false}}},
|
||||||
{col: 44, row: 25, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}},
|
{col: 44, row: 25, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// wheel
|
// wheel
|
||||||
@@ -923,7 +923,7 @@ describe('Mouse Tracking Tests', function(): void {
|
|||||||
await mouseUp('left');
|
await mouseUp('left');
|
||||||
assert.deepEqual(await getReports(encoding), [
|
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: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}},
|
||||||
{col: 51, row: 11, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}},
|
{col: 51, row: 11, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// test at max rows/cols
|
// test at max rows/cols
|
||||||
@@ -932,7 +932,7 @@ describe('Mouse Tracking Tests', function(): void {
|
|||||||
await mouseUp('left');
|
await mouseUp('left');
|
||||||
assert.deepEqual(await getReports(encoding), [
|
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: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}},
|
||||||
{col: cols, row: rows, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}},
|
{col: cols, row: rows, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// button press/move/release tests
|
// button press/move/release tests
|
||||||
@@ -945,7 +945,7 @@ describe('Mouse Tracking Tests', function(): void {
|
|||||||
await mouseUp('left');
|
await mouseUp('left');
|
||||||
assert.deepEqual(await getReports(encoding), [
|
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: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}},
|
||||||
{col: 44, row: 25, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}},
|
{col: 44, row: 25, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}}
|
||||||
]);
|
]);
|
||||||
// middle button
|
// middle button
|
||||||
// bug: default action not cancelled (adds data to getReports from clipboard under X11)
|
// bug: default action not cancelled (adds data to getReports from clipboard under X11)
|
||||||
@@ -965,7 +965,7 @@ describe('Mouse Tracking Tests', function(): void {
|
|||||||
await mouseUp('right');
|
await mouseUp('right');
|
||||||
assert.deepEqual(await getReports(encoding), [
|
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: 'press', button: 'right', modifier: {control: false, shift: false, meta: false}}},
|
||||||
{col: 44, row: 25, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}},
|
{col: 44, row: 25, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// wheel
|
// wheel
|
||||||
@@ -1081,7 +1081,7 @@ describe('Mouse Tracking Tests', function(): void {
|
|||||||
await mouseUp('left');
|
await mouseUp('left');
|
||||||
assert.deepEqual(await getReports(encoding), [
|
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: '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
|
// test at max rows/cols
|
||||||
@@ -1090,7 +1090,7 @@ describe('Mouse Tracking Tests', function(): void {
|
|||||||
await mouseUp('left');
|
await mouseUp('left');
|
||||||
assert.deepEqual(await getReports(encoding), [
|
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: '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
|
// button press/move/release tests
|
||||||
@@ -1103,7 +1103,7 @@ describe('Mouse Tracking Tests', function(): void {
|
|||||||
await mouseUp('left');
|
await mouseUp('left');
|
||||||
assert.deepEqual(await getReports(encoding), [
|
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: '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
|
// middle button
|
||||||
// bug: default action not cancelled (adds data to getReports from clipboard under X11)
|
// bug: default action not cancelled (adds data to getReports from clipboard under X11)
|
||||||
@@ -1124,7 +1124,7 @@ describe('Mouse Tracking Tests', function(): void {
|
|||||||
await mouseUp('right');
|
await mouseUp('right');
|
||||||
assert.deepEqual(await getReports(encoding), [
|
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: '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
|
// wheel
|
||||||
@@ -1240,7 +1240,7 @@ describe('Mouse Tracking Tests', function(): void {
|
|||||||
await mouseUp('left');
|
await mouseUp('left');
|
||||||
assert.deepEqual(await getReports(encoding), [
|
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: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}},
|
||||||
{col: 51, row: 11, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}},
|
{col: 51, row: 11, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// test at max rows/cols
|
// test at max rows/cols
|
||||||
@@ -1249,7 +1249,7 @@ describe('Mouse Tracking Tests', function(): void {
|
|||||||
await mouseUp('left');
|
await mouseUp('left');
|
||||||
assert.deepEqual(await getReports(encoding), [
|
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: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}},
|
||||||
{col: cols, row: rows, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}},
|
{col: cols, row: rows, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// button press/move/release tests
|
// button press/move/release tests
|
||||||
@@ -1262,7 +1262,7 @@ describe('Mouse Tracking Tests', function(): void {
|
|||||||
await mouseUp('left');
|
await mouseUp('left');
|
||||||
assert.deepEqual(await getReports(encoding), [
|
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: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}},
|
||||||
{col: 44, row: 25, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}},
|
{col: 44, row: 25, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}}
|
||||||
]);
|
]);
|
||||||
// middle button
|
// middle button
|
||||||
// bug: default action not cancelled (adds data to getReports from clipboard under X11)
|
// bug: default action not cancelled (adds data to getReports from clipboard under X11)
|
||||||
@@ -1282,7 +1282,7 @@ describe('Mouse Tracking Tests', function(): void {
|
|||||||
await mouseUp('right');
|
await mouseUp('right');
|
||||||
assert.deepEqual(await getReports(encoding), [
|
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: 'press', button: 'right', modifier: {control: false, shift: false, meta: false}}},
|
||||||
{col: 44, row: 25, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}},
|
{col: 44, row: 25, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// wheel
|
// wheel
|
||||||
@@ -1407,7 +1407,7 @@ describe('Mouse Tracking Tests', function(): void {
|
|||||||
await mouseUp('left');
|
await mouseUp('left');
|
||||||
assert.deepEqual(await getReports(encoding), [
|
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: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}},
|
||||||
{col: 51, row: 11, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}},
|
{col: 51, row: 11, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// test at max rows/cols
|
// test at max rows/cols
|
||||||
@@ -1418,7 +1418,7 @@ describe('Mouse Tracking Tests', function(): void {
|
|||||||
await mouseUp('left');
|
await mouseUp('left');
|
||||||
assert.deepEqual(await getReports(encoding), [
|
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: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}},
|
||||||
{col: 95, row: rows, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}},
|
{col: 95, row: rows, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// button press/move/release tests
|
// button press/move/release tests
|
||||||
@@ -1431,7 +1431,7 @@ describe('Mouse Tracking Tests', function(): void {
|
|||||||
assert.deepEqual(await getReports(encoding), [
|
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: '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: 'move', button: 'left', modifier: {control: false, shift: false, meta: false}}},
|
||||||
{col: 45, row: 25, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}},
|
{col: 45, row: 25, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}}
|
||||||
]);
|
]);
|
||||||
// middle button
|
// middle button
|
||||||
// bug: default action not cancelled (adds data to getReports from clipboard under X11)
|
// bug: default action not cancelled (adds data to getReports from clipboard under X11)
|
||||||
@@ -1451,7 +1451,7 @@ describe('Mouse Tracking Tests', function(): void {
|
|||||||
assert.deepEqual(await getReports(encoding), [
|
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: '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: 'move', button: 'right', modifier: {control: false, shift: false, meta: false}}},
|
||||||
{col: 45, row: 25, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}},
|
{col: 45, row: 25, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// wheel
|
// wheel
|
||||||
@@ -1573,7 +1573,7 @@ describe('Mouse Tracking Tests', function(): void {
|
|||||||
await mouseUp('left');
|
await mouseUp('left');
|
||||||
assert.deepEqual(await getReports(encoding), [
|
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: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}},
|
||||||
{col: 51, row: 11, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}},
|
{col: 51, row: 11, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// test at max rows/cols
|
// test at max rows/cols
|
||||||
@@ -1582,7 +1582,7 @@ describe('Mouse Tracking Tests', function(): void {
|
|||||||
await mouseUp('left');
|
await mouseUp('left');
|
||||||
assert.deepEqual(await getReports(encoding), [
|
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: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}},
|
||||||
{col: cols, row: rows, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}},
|
{col: cols, row: rows, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// button press/move/release tests
|
// button press/move/release tests
|
||||||
@@ -1595,7 +1595,7 @@ describe('Mouse Tracking Tests', function(): void {
|
|||||||
assert.deepEqual(await getReports(encoding), [
|
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: '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: 'move', button: 'left', modifier: {control: false, shift: false, meta: false}}},
|
||||||
{col: 45, row: 25, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}},
|
{col: 45, row: 25, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}}
|
||||||
]);
|
]);
|
||||||
// middle button
|
// middle button
|
||||||
// bug: default action not cancelled (adds data to getReports from clipboard under X11)
|
// bug: default action not cancelled (adds data to getReports from clipboard under X11)
|
||||||
@@ -1615,7 +1615,7 @@ describe('Mouse Tracking Tests', function(): void {
|
|||||||
assert.deepEqual(await getReports(encoding), [
|
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: '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: 'move', button: 'right', modifier: {control: false, shift: false, meta: false}}},
|
||||||
{col: 45, row: 25, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}},
|
{col: 45, row: 25, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// wheel
|
// wheel
|
||||||
@@ -1736,7 +1736,7 @@ describe('Mouse Tracking Tests', function(): void {
|
|||||||
await mouseUp('left');
|
await mouseUp('left');
|
||||||
assert.deepEqual(await getReports(encoding), [
|
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: '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
|
// test at max rows/cols
|
||||||
@@ -1745,7 +1745,7 @@ describe('Mouse Tracking Tests', function(): void {
|
|||||||
await mouseUp('left');
|
await mouseUp('left');
|
||||||
assert.deepEqual(await getReports(encoding), [
|
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: '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
|
// button press/move/release tests
|
||||||
@@ -1758,7 +1758,7 @@ describe('Mouse Tracking Tests', function(): void {
|
|||||||
assert.deepEqual(await getReports(encoding), [
|
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: '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: '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
|
// middle button
|
||||||
// bug: default action not cancelled (adds data to getReports from clipboard under X11)
|
// bug: default action not cancelled (adds data to getReports from clipboard under X11)
|
||||||
@@ -1779,7 +1779,7 @@ describe('Mouse Tracking Tests', function(): void {
|
|||||||
assert.deepEqual(await getReports(encoding), [
|
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: '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: '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
|
// wheel
|
||||||
@@ -1900,7 +1900,7 @@ describe('Mouse Tracking Tests', function(): void {
|
|||||||
await mouseUp('left');
|
await mouseUp('left');
|
||||||
assert.deepEqual(await getReports(encoding), [
|
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: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}},
|
||||||
{col: 51, row: 11, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}},
|
{col: 51, row: 11, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// test at max rows/cols
|
// test at max rows/cols
|
||||||
@@ -1909,7 +1909,7 @@ describe('Mouse Tracking Tests', function(): void {
|
|||||||
await mouseUp('left');
|
await mouseUp('left');
|
||||||
assert.deepEqual(await getReports(encoding), [
|
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: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}},
|
||||||
{col: cols, row: rows, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}},
|
{col: cols, row: rows, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// button press/move/release tests
|
// button press/move/release tests
|
||||||
@@ -1922,7 +1922,7 @@ describe('Mouse Tracking Tests', function(): void {
|
|||||||
assert.deepEqual(await getReports(encoding), [
|
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: '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: 'move', button: 'left', modifier: {control: false, shift: false, meta: false}}},
|
||||||
{col: 45, row: 25, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}},
|
{col: 45, row: 25, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}}
|
||||||
]);
|
]);
|
||||||
// middle button
|
// middle button
|
||||||
// bug: default action not cancelled (adds data to getReports from clipboard under X11)
|
// bug: default action not cancelled (adds data to getReports from clipboard under X11)
|
||||||
@@ -1942,7 +1942,7 @@ describe('Mouse Tracking Tests', function(): void {
|
|||||||
assert.deepEqual(await getReports(encoding), [
|
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: '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: 'move', button: 'right', modifier: {control: false, shift: false, meta: false}}},
|
||||||
{col: 45, row: 25, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}},
|
{col: 45, row: 25, state: {action: 'release', button: '<none>', modifier: {control: false, shift: false, meta: false}}}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// wheel
|
// wheel
|
||||||
|
|||||||
Reference in New Issue
Block a user