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
-
Method Summary
Modifier and TypeMethodDescriptionint
Gets the rotation of the mouse wheel.void
init()
Initialisationboolean
isClicked
(int button) boolean
Checks if a key is currently being clicked in any form.boolean
isHold
(int button) boolean
isReleased
(int button) void
void
void
void
void
void
void
void
void
Updates after input circlevoid
reset()
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:
mousePressed
in 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:
mouseReleased
in interfaceMouseListener
-
mouseMoved
- Specified by:
mouseMoved
in interfaceMouseMotionListener
-
mouseDragged
- Specified by:
mouseDragged
in interfaceMouseMotionListener
-
mouseClicked
- Specified by:
mouseClicked
in interfaceMouseListener
-
mouseEntered
- Specified by:
mouseEntered
in interfaceMouseListener
-
mouseExited
- Specified by:
mouseExited
in interfaceMouseListener
-
mouseWheelMoved
- Specified by:
mouseWheelMoved
in interfaceMouseWheelListener
-