This property will contain a value to indicate the mouse button that was pressed to trigger the event.
Note that on a Macintosh, this value is meaningless as there is only one button on an Apple Macintosh mouse although you can retrofit a third party 2 or 3 button mouse.
Third party mice can be added to Apple Macintosh systems to provide multiple (2 or 3) button functionality, but they are by no means commonplace and it is probably safe to assume only a 1 button mouse on the Macintosh platform.
The values for the buttons are defined to cope with 1, 2 or 3 button mice.
The following values correspond with mouse buttons:
0 - No mouse button was pressed when the event was triggered
1 - The left button was pressed
2 - The right button was pressed
3 - The middle button was pressed
DOM level 2 event handling moves this property to the MouseEvent object.
This is not supported by Netscape which returns mouse button values and key codes in the same property (which).
See also: | Event.which, MouseEvent.button, onClick, onDblClick, onMouseDown, onMouseUp |
Prev | Home | Next |
Event.bubbles | Up | Event.cancelable |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |