Pre Exam Test Practice (SSC | Banking | IAS | GATE | State Level | CLAT | Railways | Insurance | Teaching Exams | NDA | Defence | IES |State Exam )

Organizational Research By

Surprising Reserch 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) {
    //run code for CTRL+S -- ie, save!

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

Related Hot Questions

Government Jobs Opening

" rel="nofollow" target="_blank">">
answered Sep 9, 2015 by CCPRonicqlmk