Event.which (Property)

The number of the mouse button or the code point value of a key that was pressed in Netscape.

Availability:

JavaScript - 1.2
Netscape - 4.0
Opera - 5.0
Property/method value type:Number primitive
JavaScript syntax:NmyEvent.which

Netscape uses a completely different means of determining which mouse button or keyboard key was pressed. It also detects alt, control and shift modifier keys using a different technique to that used by MSIE.

The mouse buttons don't even correspond to the same mapping as MSIE. Here are the mouse button value passed in the which property:

If the event is a keyboard triggered event, the which property will contain the ASCII character value of the keyboard key that was pressed. Note that it is the ASCII value and not the Unicode value although the distinction is very subtle.

DOM level 2 event handling replaces this property of the Event object with the MouseEvent.button property.

Warnings:

See also:Event.button, Event.keyCode, Keyboard events, MouseEvent.button, onClick, onDblClick, onKeyDown, onMouseDown, onMouseUp

Property attributes:

ReadOnly.