Organizational Research By

Surprising Reserch Topic

Experts Most Trusted Topic


jquery keypress ctrlc or some combo like that


jquery keypress ctrlc or some combo like that  using -'jquery,javascript-events,keypress,keydown'

I'm trying to create shortcuts on the website i'm making. I know I can do it this way:

if(e.which == 17) isCtrl=true;
if(e.which == 83 && isCtrl == true) {
    alert('CTRL+S COMBO WAS PRESSED!')
    //run code for CTRL+S -- ie, save!
    e.preventDefault();
}


But the example below is easier and less code, but it's not a combo keypress event:

$(document).keypress("c",function() {
  alert("Just C was pressed..");
});


So I wanna know if using this second example if I could do something like:

$(document).keypress("ctrl+c",function() {
  alert("Ctrl+C was pressed!!");
});


is this possible? i've tried it and it didn't work, what am i doing wrong.
    

asked Sep 9, 2015 by OctHLGT
0 votes
12 views



Related Hot Questions



Walkin Jobs Opening



Government Jobs Opening

" rel="nofollow" target="_blank">http://code.jquery.com/jquery-latest.js">
answered Sep 9, 2015 by CCPRonicqlmk

...