Re: Letters as Shortcut for Buttons
Posted: Mon Jun 06, 2016 8:06 am
I guess that depends on what 'event' is in your example...
Code: Select all
window.ericsLovelyKeydownRoutine = function(event) {
event = event || window.event;
var key = event.which || event.keyCode;
if(key == 89) {
// 'Y' key pressed
pui.click("btnYes");
}
if(key == 78) {
// 'N' key pressed
pui.click("btnNo");
}
}
addEvent(document, "keydown", window.ericsLovelyKeydownRoutine);
Code: Select all
removeEvent(document, "keydown", window.ericsLovelyKeydownRoutine);