Mouse

Mouse

This handles all inputs from mouse and touchpad on laptops

Constructor

new Mouse(eh)

Source:
Parameters:
Name Type Description
eh DOMEventHandler

Classes

Mouse

Members

clickCount :number

Description:
  • Number of times the mouse has been clicked.
Source:
Number of times the mouse has been clicked.
Type:
  • number

delta :Vector_like

Description:
  • Distance vector between the last frame's position and current position.
Source:
Distance vector between the last frame's position and current position.
Type:

dragLastPosition :Vector_like

Description:
  • The position from which the mouse is being dragged.
Source:
The position from which the mouse is being dragged.
Type:

dragging :boolean

Description:
  • If the mouse is being dragged or not.
Source:
If the mouse is being dragged or not.
Type:
  • boolean

lastPosition :Vector_like

Description:
  • Position of the mouse in last frame.
Source:
Position of the mouse in last frame.
Type:

leftbutton :boolean

Description:
  • If the left mouse button is pressed or not.
Source:
If the left mouse button is pressed or not.
Type:
  • boolean

position :Vector_like

Description:
  • Position of the mouse in current frame.
Source:
Position of the mouse in current frame.
Type:

rightbutton :boolean

Description:
  • If the right mouse button is pressed or not.
Source:
If the right mouse button is pressed or not.
Type:
  • boolean

Methods

inDragBox(pos) → {Boolean}

Description:
  • Checks to see if the vector provided is within a dragbox if mouse is being dragged with a right or left button down
Source:
Parameters:
Name Type Description
pos Vector_like an object containing x and y coordinates to be checked
Returns:
Type
Boolean

init(eh)

Description:
  • Initializes the mouse by appending to the DOM
Source:
Parameters:
Name Type Description
eh DOMEventHandler

update()

Description:
  • Updates the mouse internals.
Source: