Package net.java.games.input
Class Mouse
java.lang.Object
net.java.games.input.AbstractController
net.java.games.input.Mouse
- All Implemented Interfaces:
Controller
A Mouse is a type of controller consisting of two child controllers,
a ball and a button pad. This includes devices such as touch pads,
trackballs, and fingersticks.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.java.games.input.Controller
Controller.PortType, Controller.Type
-
Constructor Summary
ModifierConstructorDescriptionprotected
Mouse
(String name, Component[] components, AbstractController[] children, Rumbler[] rumblers) -
Method Summary
Modifier and TypeMethodDescriptiongetBack()
Returns the back mouse button, null if the mouse hasn't got one.Returns forth mouse button, null if the mouse hasn't got one.Returns fifth mouse button, null if the mouse hasn't got one.getExtra()
Returns the extra or 5th mouse button, null if the mouse has fewer than 5 buttons.Returns the forward mouse button, null if the mouse hasn't got one.getLeft()
Returns the left mouse button.Returns the middle, null if the mouse has fewer than three buttons.Returns the left or primary mouse button, never null.getRight()
Returns the right, null if the mouse is a single-button mouse.Returns the right or secondary mouse button, null if the mouse is a single-button mouse.getSide()
Returns the side or 4th mouse button, null if the mouse has fewer than 4 buttons.Returns the middle or tertiary mouse button, null if the mouse has fewer than three buttons.getType()
Returns the type of the Controller.getWheel()
Returns the mouse wheel, or null if no mouse wheel is present.getX()
Returns the x-axis for the mouse ball, never null.getY()
Returns the y-axis for the mouse ball, never null.Methods inherited from class net.java.games.input.AbstractController
equals, getComponent, getComponents, getControllers, getEventQueue, getName, getNextDeviceEvent, getPortNumber, getPortType, getRumblers, poll, pollDevice, setDeviceEventQueueSize, setEventQueueSize, toString
-
Constructor Details
-
Mouse
protected Mouse(String name, Component[] components, AbstractController[] children, Rumbler[] rumblers)
-
-
Method Details
-
getType
Returns the type of the Controller.- Specified by:
getType
in interfaceController
- Overrides:
getType
in classAbstractController
-
getX
Returns the x-axis for the mouse ball, never null. -
getY
Returns the y-axis for the mouse ball, never null. -
getWheel
Returns the mouse wheel, or null if no mouse wheel is present. -
getPrimaryButton
Returns the left or primary mouse button, never null. -
getSecondaryButton
Returns the right or secondary mouse button, null if the mouse is a single-button mouse. -
getTertiaryButton
Returns the middle or tertiary mouse button, null if the mouse has fewer than three buttons. -
getLeft
Returns the left mouse button. -
getRight
Returns the right, null if the mouse is a single-button mouse. -
getMiddle
Returns the middle, null if the mouse has fewer than three buttons. -
getSide
Returns the side or 4th mouse button, null if the mouse has fewer than 4 buttons. -
getExtra
Returns the extra or 5th mouse button, null if the mouse has fewer than 5 buttons. -
getForward
Returns the forward mouse button, null if the mouse hasn't got one. -
getBack
Returns the back mouse button, null if the mouse hasn't got one. -
getButton3
Returns forth mouse button, null if the mouse hasn't got one. -
getButton4
Returns fifth mouse button, null if the mouse hasn't got one.
-