MCPcopy
hub / github.com/autoNumeric/autoNumeric / sendCtrlChar

Function sendCtrlChar

test/e2e/specs/autoNumeric.e2e.spec.js:327–342  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

325 * @returns {Promise<void>}
326 */
327const sendCtrlChar = async char => {
328 // based on https://stackoverflow.com/questions/75092823/webdriverio-browser-keysdown-arrow-is-not-working-for-a-specific-custom-drop
329 await browser.performActions([{
330 type: 'key',
331 id: 'keyboard',
332 actions: [
333 { type: 'keyDown', value: '\uE009' },
334 { type: 'pause', duration: 50 }, // 50ms might not be enough in all environments
335 { type: 'keyDown', value: char },
336 { type: 'pause', duration: 50 },
337 { type: 'keyUp', value: char },
338 { type: 'pause', duration: 50 },
339 { type: 'keyUp', value: '\uE009' },
340 ],
341 }]);
342};
343
344/**
345 * Returns true or false depending on whether the given input is hovered

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected