Expectations:
I want to dispatch multiple keypress events simutamusly. For example, I want my test to simulate a shift+tab event with
The code :
...
describe("ESC press", () => {
// How do i use this dispatch event to simulate a key press of shift+tab
document.dispatchEvent(escapeEvent)
});
...
Use this technique twice to simulate multiple hold key events :
const shift = new KeyboardEvent('keydown', {'keyCode': 16});
document.dispatchEvent(event);
const tab = new KeyboardEvent('keydown', {'keyCode': 9});
document.dispatchEvent(event);
Cheers