public interface MouseEvent extends UiEventModifier
This event occurs when a user performs an action with a pointing device (such as a mouse), for example moves the mouse or clicks a mouse button.
Modifier and Type | Interface and Description |
---|---|
static class |
MouseEvent.Button
A DOM mouse button.
|
Modifier and Type | Method and Description |
---|---|
MouseEvent.Button |
button()
Returns a button pressed during events caused by pressing or releasing one or multiple
buttons.
|
int |
clickCount()
Returns the count of consecutive clicks that happened in a short amount of time for mouse
events, such as "click", "mouseDown, "mouseUp".
|
Point |
clientLocation()
Returns the location of the mouse cursor in the local (DOM content) coordinate system at the time the
event occurred.
|
Point |
offsetLocation()
Returns the location of the mouse cursor in the component's coordinate system at the time the
event occurred.
|
Point |
screenLocation()
Returns the location of the mouse cursor in the screen's coordinate system at the time the
event occurred.
|
keyModifiers
currentTarget, isBubbles, isCancelable, phase, preventDefault, stopPropagation, target, type
Point clientLocation()
Point screenLocation()
Point offsetLocation()
For example, clicking in the top-left corner of the client area will always result in
that the x
field of the result equals 0, regardless of whether the page is scrolled
horizontally.
MouseEvent.Button button()
mouseenter
, mouseleave
, mouseover
, mouseout
or mousemove
.
Users may change the configuration of buttons on their pointing device so that if an
event's button property is MouseEvent.Button.MAIN
(left), it may not have been caused by the
button that is physically left–most on the pointing device; however, it should behave as if
the left button was clicked in the standard button layout.
int clickCount()
For all other UI events returns 0.