wiiremotej
Class RelativeAnalogStickMouse
java.lang.Object
wiiremotej.WiiRemoteMouse
wiiremotej.AnalogStickMouse
wiiremotej.RelativeAnalogStickMouse
public class RelativeAnalogStickMouse
- extends AnalogStickMouse
A class for implementing a mouse using an analog stick with relative positioning. This means that pressing the analog stick will cause the cursor to move based on
the direction of the analog stick. However, the cursor will not be mapped to the analog stick's coordinate system. Any analog stick may be used.
Constructor Summary |
RelativeAnalogStickMouse(double xSensitivity,
double ySensitivity,
double xThreshold,
double yThreshold,
int analogStick)
Creates a new RelativeAnalogStickMouse with the given settings. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RelativeAnalogStickMouse
public RelativeAnalogStickMouse(double xSensitivity,
double ySensitivity,
double xThreshold,
double yThreshold,
int analogStick)
throws java.lang.IllegalArgumentException,
java.awt.AWTException,
java.lang.SecurityException
- Creates a new RelativeAnalogStickMouse with the given settings.
- Parameters:
xSensitivity
- pixels to multiply by percent of analog stick's X direction. A negative modifier will move the mouse the opposite way.ySensitivity
- pixels to multiply by percent of analog stick's Y direction. A negative modifier will move the mouse the opposite way.xThreshold
- the amount the analog has to be pushed left or right before responding (percent on the 0 to 1 scale).yThreshold
- the amount the analog has to be pushed up or down before responding (percent on the 0 to 1 scale).analogStick
- the analog stick that this mouse uses. See field constants of this class for possible values.
- Throws:
java.awt.AWTException
- if the platform configuration does not allow low-level input control. This exception is always
thrown when GraphicsEnvironment.isHeadless() returns true.
java.lang.SecurityException
- if createRobot permission is not granted.
java.lang.IllegalArgumentException
processMouseEvent
public void processMouseEvent(AnalogStickData analogStickData)
- Processes analog stick data from an event and moves the mouse if necessary.
- Specified by:
processMouseEvent
in class AnalogStickMouse
- Parameters:
analogStickData
- the analog stick data to process.
getDefault
public static RelativeAnalogStickMouse getDefault()
throws java.awt.AWTException,
java.lang.SecurityException
- Returns a basic relative analog stick mouse with the following settings. xSensitivity: 10. ySensitivity: 10. xThreshold: 0.05. yThreshold: 0.05.
analogStick: NUNHCUCK.
- Returns:
- a basic relative analog stick mouse.
- Throws:
java.awt.AWTException
- if the platform configuration does not allow low-level input control. This exception is always
thrown when GraphicsEnvironment.isHeadless() returns true.
java.lang.SecurityException
- if createRobot permission is not granted.