I have my program in PHP and Javacript for Firefox
I want to emulate on Javascript a hotkey (ALT + K) without jQuery. I want to send that hotkey to my browser pressing a created button. It is possible?
I have this function on my code but it doesn't work:
try {
var pressEvent = document.createEvent('KeyboardEvent');
pressEvent.initKeyEvent("keypress",true,true,null,false,true,false,false,75, 0);
document.body.dispatchEvent(pressEvent); // Press the key.
} catch (e) {
alert ("Your browser does not support this example!");
}
Please I need to send this hotkey to the browser to show screen-keyboard.