public class GlfwMouseInputVR extends java.lang.Object implements MouseInput
update()
method. Due to some of the GLFW button id's there is a conversion method in this class which will
convert the GLFW left, middle and right mouse button to JME3 left, middle and right button codes.AXIS_WHEEL, AXIS_X, AXIS_Y, BUTTON_LEFT, BUTTON_MIDDLE, BUTTON_RIGHT
Constructor and Description |
---|
GlfwMouseInputVR(LwjglWindowVR context)
Create a new mouse input attached to the given
context . |
Modifier and Type | Method and Description |
---|---|
void |
clearDeltas()
Clear the last x and y deltas.
|
void |
destroy()
Ceases listening to events from the device.
|
int |
getButtonCount()
Returns the number of buttons the mouse has.
|
long |
getInputTimeNanos() |
int |
getLastDeltaX()
Get the last delta in x (pixel).
|
int |
getLastDeltaY()
Get the last delta in y (pixel).
|
void |
hideActiveCursor()
Hide the active cursor within the display.
|
void |
initialize()
Initializes the native side to listen into events from the device.
|
boolean |
isInitialized()
Check if the input is initialized.
|
void |
setCursorPosition(int x,
int y)
Set the position of the cursor on the display.
|
void |
setCursorVisible(boolean visible)
Set whether the mouse cursor should be visible or not.
|
void |
setInputListener(RawInputListener listener)
Sets the input listener to receive events from this device.
|
void |
setNativeCursor(JmeCursor jmeCursor)
Sets the cursor to use.
|
void |
update()
Queries the device for input.
|
public GlfwMouseInputVR(LwjglWindowVR context)
context
.context
- the context to which to attach the input.public void initialize()
Input
initialize
in interface Input
public void setCursorPosition(int x, int y)
x
- the x position of the cursor (pixel).y
- the y position of the cursor (pixel).public void hideActiveCursor()
public int getLastDeltaX()
getLastDeltaY()
public int getLastDeltaY()
getLastDeltaX()
public void clearDeltas()
getLastDeltaX()
,
getLastDeltaY()
public boolean isInitialized()
isInitialized
in interface Input
true
if the input is initialized and false
otherwise.Input.initialize()
,
Input.destroy()
public int getButtonCount()
MouseInput
getButtonCount
in interface MouseInput
public void update()
Input
update
in interface Input
Input.setInputListener(com.jme3.input.RawInputListener)
public void destroy()
Input
public void setCursorVisible(boolean visible)
MouseInput
setCursorVisible
in interface MouseInput
visible
- Whether the mouse cursor should be visible or not.public void setInputListener(RawInputListener listener)
Input
setInputListener
in interface Input
listener
- the desired listenerpublic long getInputTimeNanos()
getInputTimeNanos
in interface Input
public void setNativeCursor(JmeCursor jmeCursor)
MouseInput
setNativeCursor
in interface MouseInput
jmeCursor
- The cursor to use.