javascript - Can I detect a leftclick from mouse? Or Ctrl+Right Click? -
i'm trying detect if user pressed left mouse button or right button + ctrl key, i'm not sure how this.
i know detect click, use
<li onclick=\"dosomething()\">
is there function
<li onleftclick=\"dosomething()\"> ?
with jquery 1 like
$(document).click(function(e) { if (e.button == 0) { // left button alert('clicked'); } });
and normal javascript there should kind of event variable accessible in onclick function
perhaps this'll yet don't know if still accurate
Comments
Post a Comment