Assigning hotkeys to custom buttons in Sage CRM
- by CodeGeek
Hi All,
I'm trying to assign a hotkey to a custom buttom in Sage CRM. I'm able to do so for one keypress. However, it doesn't seem to work if I try to use a combination of keys, for example, 'Alt+C' Please refer my code below:
document.onkeypress = onKeyPress;
var flag = false;
function onKeyPress()
{
if(window.event.keyCode == 18)
{
flag = true;
}
if(window.event.keyCode == 67 && flag)
{
alert("Successful!!!");
}
}