BiMouseEvent
This class describes event objects used in mouse events.
All mouse events bubble by default. This means that once all the
event listeners have been notified the event propagates to the parent
BiComponent. To prevent the event to
bubble to the parent call
stopPropagation() on the event object.
The currently supported events by BiComponent
are:
mousedown
mouseup
click
dblclick
contextmenu - this one is a bit tricky since it might also be dispatched when the user presses the context menu key on their keyboard
mouseover
mouseout
mousemove
mousewheel
When a user double clicks on a component the order of the mouse events is
the following:
mousedown
mouseup
click
mousedown
mouseup
click
dblclick
This object should not be created by the user. It is created as needed by the event system.
This class extends
BiEvent
and therefore all methods and fields available for
BiEvent
are also available for
BiMouseEvent
.
Constructor
new
BiMouseEvent
(
sType,oEvent
)
Parameters
| Name | Type | Optional | Default | Descripton |
sType |
String |
The type (name) of the event. | ||
oEvent |
Object |
This is the internal browser event object. |
Properties
| Name | Type | get | set | Descripton |
altKey |
Boolean |
![]() |
Whether the alt key pressed. | |
button |
Number |
![]() |
Returns a number representing the mouse button that is pressed. | |
clientX |
Number |
![]() |
The position of the mouse pointer relative to the browser viewport. | |
clientY |
Number |
![]() |
The position of the mouse pointer relative to the browser viewport. | |
ctrlKey |
Boolean |
![]() |
Whether the ctrl key pressed. | |
offsetX |
Number |
![]() |
The position of the mouse pointer relative to the event target. | |
offsetY |
Number |
![]() |
The position of the mouse pointer relative to the event target. | |
relatedTarget |
|
![]() |
The related target is used with mouseover and mouseout events. In a mouseover event the related target is the component that the mouse pointer left and for a mouseout it is the component that the mouse entered. | |
screenX |
Number |
![]() |
The position of the mouse pointer relative to the screen. | |
screenY |
Number |
![]() |
The position of the mouse pointer relative to the screen. | |
shiftKey |
Boolean |
![]() |
Whether the shift key pressed. | |
wheelDelta |
Number |
![]() |
The amount that the user scrolled the mouse wheel. |
Methods
None.
Events
None.
Static Methods
| Name | Description |
getButton |
Returns the last recorded mouse button used in a mouse event. |
getClientX |
This returns the last recorded left mouse position relative to the browser view port (client area). |
getClientY |
This returns the last recorded top mouse position relative to the browser view port (client area). |
getScreenX |
This returns the last recorded left mouse position relative to the screen. |
getScreenY |
This returns the last recorded top mouse position relative to the screen. |
Static Fields
| Name | Type | Descripton |
LEFT |
Number |
Constant used to test whether the left button is pressed. |
MIDDLE |
Number |
Constant used to test whether the right button is pressed. |
NONE |
Number |
Constant used to test whether no button is pressed. |
RIGHT |
Number |
Constant used to test whether the middle button is pressed. |
Remarks
This object should not be created by the user. It is created as needed by the event system.
Static Method Details
getButton
Returns the last recorded mouse button used in a mouse event.
Syntax
BiMouseEvent . getButton ( )
Parameters
No arguments.
Return Type
Number
getClientX
This returns the last recorded left mouse position relative to the browser view port (client area).
Syntax
BiMouseEvent . getClientX ( )
Parameters
No arguments.
Return Type
Number
getClientY
This returns the last recorded top mouse position relative to the browser view port (client area).
Syntax
BiMouseEvent . getClientY ( )
Parameters
No arguments.
Return Type
Number
getScreenX
This returns the last recorded left mouse position relative to the screen.
Syntax
BiMouseEvent . getScreenX ( )
Parameters
No arguments.
Return Type
Number
getScreenY
This returns the last recorded top mouse position relative to the screen.
Syntax
BiMouseEvent . getScreenY ( )
Parameters
No arguments.
Return Type
Number
