W3C home > Mailing lists > Public > www-dom@w3.org > January to March 2001

MouseEvent button attribute

From: Jeff Yates <pbwiz@hotmail.com>
Date: Sun, 4 Feb 2001 02:42:19 -0500
To: <www-dom@w3.org>
Message-ID: <OE39kvdIBirXXeQM7gy000019e3@hotmail.com>
I have been programing in JavaScript in Mozilla, and I have noticed that they do not apply the button attribute in the MouseEvent they way you recommend (DOM: 0=left, 1=middle, 2=right  Moz:1=left, 2=middle, 3=right).  Has the W3C DOM recomendation been updated, or has Mozilla just improperly applied it?

I would also recommend adding buttonLeft, buttonRight and buttonMiddle properties to show when multiple buttons are being pressed, and keep the button property to show which one is being pressed for this event (pressed last).  Here is an example of why it is important to know:  Right click on the document and hold.  Drag the mouse out of the browser window.  Bring the mouse back into the window and left click on the document.  If you were trying to capture a left AND right click by keeping track of the mousedown and mouseup events then this method would fail (mouseup does not happen when it is release outside of the browser).

Thank you.

Jeff.
Received on Sunday, 4 February 2001 02:44:58 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:48 GMT