Package buildengine.engine.input
Class Mouse
java.lang.Object
buildengine.engine.input.Mouse
- All Implemented Interfaces:
MouseListener,MouseMotionListener,MouseWheelListener,EventListener
All mouse movement and click handling.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintGets the rotation of the mouse wheel.voidinit()InitialisationbooleanisClicked(int button) booleanChecks if a key is currently being clicked in any form.booleanisHold(int button) booleanisReleased(int button) voidvoidvoidvoidvoidvoidvoidvoidvoidUpdates after input circlevoidreset()Resets all values
-
Constructor Details
-
Mouse
public Mouse()
-
-
Method Details
-
init
public void init()Initialisation -
pollEvents
public void pollEvents()Updates after input circle -
reset
public void reset()Resets all values -
mousePressed
- Specified by:
mousePressedin interfaceMouseListener
-
isClicked
Checks if a key is currently being clicked in any form.- Parameters:
key- The keycode of the key that's possibly being clicked.type- The type of the click. For exampleClickType.HOLD- Returns:
- If the key is being pressed or not.
-
isHold
public boolean isHold(int button) -
isClicked
public boolean isClicked(int button) -
isReleased
public boolean isReleased(int button) -
getPosition
- Returns:
- the current mouse position (pixels)
-
getMouseWheelRotation
public int getMouseWheelRotation()Gets the rotation of the mouse wheel. Each rotation "flick" returns another value.- Returns:
- -1 when turning away from the user, 1 when turning towards and 0 if there is no rotation.
-
mouseReleased
- Specified by:
mouseReleasedin interfaceMouseListener
-
mouseMoved
- Specified by:
mouseMovedin interfaceMouseMotionListener
-
mouseDragged
- Specified by:
mouseDraggedin interfaceMouseMotionListener
-
mouseClicked
- Specified by:
mouseClickedin interfaceMouseListener
-
mouseEntered
- Specified by:
mouseEnteredin interfaceMouseListener
-
mouseExited
- Specified by:
mouseExitedin interfaceMouseListener
-
mouseWheelMoved
- Specified by:
mouseWheelMovedin interfaceMouseWheelListener
-