Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect Ctrl + Mouse dblckick using jquery

I want to detect event like Ctrl + DblClick using jQuery. For dblclick I already have dblclick event. Is it possible to recognize the event without setting flag on keypress event?

like image 738
Exception Avatar asked Jun 18 '26 00:06

Exception


1 Answers

look at the passed jQuery event object. There is a boolean property called ctrlKey.

$(window).on("dblclick", function(e) {
   console.log(e.ctrlKey); 
});

here's a simple example: http://jsbin.com/ugocaf/2/edit

like image 94
epascarello Avatar answered Jun 19 '26 13:06

epascarello