MCPcopy
hub / github.com/palantir/plottable / triggerFakeKeyboardEvent

Function triggerFakeKeyboardEvent

test/testMethods.ts:330–338  ·  view source on GitHub ↗
(type: string, target: SimpleSelection<void>, keyCode: number, options?: {[key: string]: any})

Source from the content-addressed store, hash-verified

328/* tslint:enable:no-switch-case-fall-through */
329
330export function triggerFakeKeyboardEvent(type: string, target: SimpleSelection<void>, keyCode: number, options?: {[key: string]: any}) {
331 const event = <KeyboardEvent> document.createEvent("Events");
332 event.initEvent(type, true, true);
333 (event as any).keyCode = keyCode;
334 if (options != null) {
335 Object.keys(options).forEach((key) => (<any> event)[key] = options[key]);
336 }
337 (<HTMLElement> target.node()).dispatchEvent(event);
338}
339
340export function assertAreaPathCloseTo(actualPath: string, expectedPath: string, precision: number, msg: string) {
341 const actualAreaPathNumbers = tokenizePathString(actualPath);

Callers

nothing calls this directly

Calls 1

forEachMethod · 0.45

Tested by

no test coverage detected