Java Reference
In-Depth Information
Properties of the
MouseEvent Object
Description
clientX
Indicates where in the browser window, in horizontal coordinates, the
mouse pointer was when the event was generated.
clientY
Indicates where in the browser window, in vertical coordinates, the
mouse pointer was when the event was generated.
ctrlKey
Indicates whether the Ctrl key was pressed when the event was
generated.
metaKey
Indicates whether the meta key was pressed when the event was
generated.
relatedTarget
Used to identify a secondary event target. For mouseover events,
this property references the element the mouse pointer exited. For
mouseout events, this property references the element the mouse
pointer entered.
screenX
Indicates the horizontal coordinates relative to the origin in the screen
coordinates, the mouse pointer was when the event was generated.
screenY
Indicates the vertical coordinates relative to the origin in the screen coor-
dinates, the mouse pointer was when the event was generated.
shiftKey
Indicates whether the Shift key was pressed when the event was
generated.
Although any event might create an Event object, only a select set of events can generate a MouseEvent
object. On the occurrence of a MouseEvent event, you'd be able to access properties from the Event
object and the MouseEvent object. With a non-mouse event, none of the MouseEvent object properties
in the preceding table would be available. The following mouse events can create a MouseEvent event
object:
click
occurs when a mouse button is clicked (pressed and released) with the pointer over an
element or text.
occurs when a mouse button is pressed with the pointer over an element or text.
mousedown
mouseup
occurs when a mouse button is released with the pointer over an element or text.
occurs when a mouse button is moved onto an element or text.
mouseover
mousemove
occurs when a mouse button is moved and it is already on top of an element or text.
occurs when a mouse button is moved out and away from an element or text.
mouseout
Search WWH ::




Custom Search