Closed Bug 86298 Opened 24 years ago Closed 24 years ago

When capturing onMouseDown the event.button property gets the wrong value when left button is clicked.

Categories

(Core :: DOM: Events, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

VERIFIED INVALID

People

(Reporter: niklas, Assigned: joki)

References

()

Details

From Bugzilla Helper: User-Agent: Mozilla/4.0 (compatible; MSIE 6.0b; Windows NT 5.0) BuildID: 2001060703 When capturing onMouseDown the event.button property gets the wrong value when left button is clicked. The left button should set button property of the event to 1, currently its set to 0. The right button has the correct value of 2. Reproducible: Always Steps to Reproduce: 1. goto http://dahlman-group.com/bug.html 2. click on the text with left button 3. an alert pops up telling you the value of the button-property 4. The value is 0 for mozilla 0.9 and 0.91 and 1 for Opera5, IE5, Netscape6 Actual Results: The value is 0 for mozilla 0.9 and 0.91 and 1 for Opera5, IE5, Netscape6 Expected Results: The value should be 1 as it is for Opera5, IE5, Netscape6 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>ClickCheck</title> <script> function clickCheck(evt) { if( document.all ) evt = window.event; alert('event.button = ' + evt.button); } function init() { document.onmousedown = clickCheck; } </script> </head> <body onload="init();"> <div >Hello, please click me. <br> Left mousebutton should be 1 and the right should be 2 <br><br>This page does not work in Netscape 4 and only left button works in Opera.<br> But demonstrates the problem for IE5+ Netscape6+ and Mozilla 0.9/0.91 </div> </body> </html>
Excerpt from http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/events.html#Events-MouseEvent Attributes: button of type unsigned short, readonly During mouse events caused by the depression or release of a mouse button, button is used to indicate which mouse button changed state. The values for button range from zero to indicate the left button of the mouse, one to indicate the middle button if present, and two to indicate the right button. For mice configured for left handed use in which the button actions are reversed the values are instead read from right to left. Moz is doing this correctly.
Summary: When capturing onMouseDown the event.button property gets the wrong value when left button is clicked. → When capturing onMouseDown the event.button property gets the wrong value when left button is clicked.
Which would make this bug invalid. Marking as such.
Status: UNCONFIRMED → RESOLVED
Closed: 24 years ago
Resolution: --- → INVALID
verifying invalid
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.