Class: IWMouseAdapter

IWMouseAdapter

This class is used to transform a mouse event into a browser independent mouse event.

new IWMouseAdapter()

This adapter class transforms a platform dependent mouse event into a platform independent mouse event.

Methods


getButton(event)

If a button has been pressed, the method returns one of the following browser independent values:

  • IWButton.NONE - None button pressed (default)
  • IWButton.LEFT - Left button pressed
  • IWButton.MIDDLE - Middle button pressed
  • IWButton.RIGHT - Right button pressed

Parameters:
Name Type Description
event MouseEvent the mouse event
See:
Returns:
the browser independent button value
Type
number

getPosition(event, container)

Returns the current mouse position. The mouse position can be calculate absolute or relative to another container.
Parameters:
Name Type Description
event MouseEvent
container DOMNode
Returns:
the current mouse position
Type
IWPoint

toMouseEvent(event, container)

Transforms a mouse event into a browser independent mouse event.
Parameters:
Name Type Description
event MouseEvent
container HTMLDivElement
Returns:
the browser independent mouse event.
Type
IWMouseEvent

toString()

Returns a string representation of this mouse event.
Returns:
Type
String