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

http://www.javascripter.net/faq/leftvsri.htm


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -