Class zwt.event.MouseEvent
Extends
zwt.event.UIEvent.
A mouse event object is emitted when a mouse event occurs.
Defined in: MouseEvent.js.
Constructor Attributes | Constructor Name and Description |
---|---|
zwt.event.MouseEvent(event, zwt_ui_Widget_widget, int_type)
Construct a mouse event.
|
Field Attributes | Field Name and Description |
---|---|
<static> |
zwt.event.MouseEvent.LEFT_CLICK
Constant used to indicate the left mouse button
|
<static> |
zwt.event.MouseEvent.MIDDLE_CLICK
Constant used to indicate the middle mouse button
|
<static> |
zwt.event.MouseEvent.MOUSE_DOWN
Constant used to indicate a mouse down event
|
<static> |
zwt.event.MouseEvent.MOUSE_MOVE
Constant used to indicate a mouse move event
|
<static> |
zwt.event.MouseEvent.MOUSE_OUT
Constant used to indicate a mouse out event
|
<static> |
zwt.event.MouseEvent.MOUSE_OVER
Constant used to indicate a mouse over event
|
<static> |
zwt.event.MouseEvent.MOUSE_UP
Constant used to indicate a mouse up event
|
<static> |
zwt.event.MouseEvent.RIGHT_CLICK
Constant used to indicate the right mouse button
|
Method Attributes | Method Name and Description |
---|---|
Return the mouse button that was pressed.
|
|
getX()
Return the horizontal position of the cursor when the event occurs.
|
|
getY()
Return the vertical position of the cursor when the event occurs.
|
|
isAlt()
Return true if the Alt key was pressed when the event occurs.
|
|
isCtrl()
Return true if the Ctrl key was pressed when the event occurs.
|
|
isMeta()
Return true if the Meta key was pressed when the event occurs.
|
|
isShift()
Return true if the Shift key was pressed when the event occurs.
|
- Methods borrowed from class zwt.event.UIEvent:
- getBrowserEvent, getBrowserEventTarget, getReturn, getWidget, setReturn
- Methods borrowed from class zwt.event.Event:
- getType, isCancelBubble, setCancelBubble, touch
Class Detail
zwt.event.MouseEvent(event, zwt_ui_Widget_widget, int_type)
Construct a mouse event.
Author: Jeremy KUHN.
Author: Jeremy KUHN.
- Parameters:
- {Event} event
- The javaScript event object
- {zwt.ui.Widget} zwt_ui_Widget_widget
- The widget linked to the event
- {Integer} int_type
- The event type
Field Detail
<static>
{Integer}
zwt.event.MouseEvent.LEFT_CLICK
Constant used to indicate the left mouse button
<static>
{Integer}
zwt.event.MouseEvent.MIDDLE_CLICK
Constant used to indicate the middle mouse button
<static>
{Integer}
zwt.event.MouseEvent.MOUSE_DOWN
Constant used to indicate a mouse down event
<static>
{Integer}
zwt.event.MouseEvent.MOUSE_MOVE
Constant used to indicate a mouse move event
<static>
{Integer}
zwt.event.MouseEvent.MOUSE_OUT
Constant used to indicate a mouse out event
<static>
{Integer}
zwt.event.MouseEvent.MOUSE_OVER
Constant used to indicate a mouse over event
<static>
{Integer}
zwt.event.MouseEvent.MOUSE_UP
Constant used to indicate a mouse up event
<static>
{Integer}
zwt.event.MouseEvent.RIGHT_CLICK
Constant used to indicate the right mouse button
Method Detail
{Integer}
getButton()
Return the mouse button that was pressed.
- Returns:
- One of zwt.event.MouseEvent.LEFT_CLICK, zwt.event.MouseEvent.MIDDLE_CLICK or zwt.event.MouseEvent.RIGHT_CLICK
{Integer}
getX()
Return the horizontal position of the cursor when the event occurs.
- Returns:
- The X position
{Integer}
getY()
Return the vertical position of the cursor when the event occurs.
- Returns:
- The Y position
{Boolean}
isAlt()
Return true if the Alt key was pressed when the event occurs.
- Returns:
- true if Alt was pressed
{Boolean}
isCtrl()
Return true if the Ctrl key was pressed when the event occurs.
- Returns:
- true if Ctrl was pressed
{Boolean}
isMeta()
Return true if the Meta key was pressed when the event occurs.
- Returns:
- true if Meta was pressed
{Boolean}
isShift()
Return true if the Shift key was pressed when the event occurs.
- Returns:
- true if Shift was pressed