[OpenLayers-Users] right click event

Christopher Schmidt crschmidt at metacarta.com
Fri Feb 16 17:01:26 EST 2007


On Fri, Feb 16, 2007 at 01:46:46PM -0800, Ben Brehmer wrote:
> Hi List,
> 
> I'm just looking at what kind of events are available. In particular I 
> am looking for a right click event...but haven't been able to find one.
> 
> What I'm hoping to do is add a custom right click menu. Not sure if this 
> is possible?

A right click fires a normal 'click' event. OpenLayers.Event has an
'isLeftClick' function which can determine if it is a left click or some
other kind of click. THe Control.MouseDefaults code simply returns false
for clicks which are not right clicks, so you could either modify that
or add your own class which catches these events.

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list