Yakisoba
05-24-2006, 12:42 PM
I have a form that I would like the user to be able to submit when Ctrl +S is pressed...
Right now everything works,and I can capture any single key(except Alt & Ctrl). Is it possible to capture the combination. Everything I try brings up the browser "Save As" box...I would like my own function to be triggered.
My form contains a javascript function that picks out certain keystrokes using a switch/case and the ascii code of the key.
function key(){
switch (e._e.keyCode){
case 37: //<- LEFT ARROW
somthing()
break;
case 38: //^ UP ARROW
somthingElse();
break;
case ???: //Ctrl +s
save()
....
....
....
}
Any suggestions?
Thanks.
Yakisoba
Right now everything works,and I can capture any single key(except Alt & Ctrl). Is it possible to capture the combination. Everything I try brings up the browser "Save As" box...I would like my own function to be triggered.
My form contains a javascript function that picks out certain keystrokes using a switch/case and the ascii code of the key.
function key(){
switch (e._e.keyCode){
case 37: //<- LEFT ARROW
somthing()
break;
case 38: //^ UP ARROW
somthingElse();
break;
case ???: //Ctrl +s
save()
....
....
....
}
Any suggestions?
Thanks.
Yakisoba