Possible Duplicate:
Is right click a Javascript event?
I’m searching an JavaScript event, i can use for the addEventListener(‘event’,…) method.
I know there is click and dblclick. but is there an equal event for
right click and for double right click?
First of all, a
clickis triggered by a click, which is basically amousedownfollowed by amouseupin the same place, of the primary mouse button (usually left).A right-click does not count as a
clickfor the purposes of the event. However, it still registersmousedownandmouseupevents, and you can check theEvent.whichproperty to see if it’s the right mouse button being pressed. Alternatively, you may be able to useoncontextmenu, which in some cases can be considered the same as a right-click.That still leaves the problem of a double-right-click, though. For this to work, you would need to measure the time between two right-clicks, and if you deem it short enough to be a double click, then handle it as such. It’s a very complex setup, but double-right-clicks are not user-friendly at all so perhaps you should consider an alternative input?