public class AwtMouseInput extends java.lang.Object implements MouseInput, java.awt.event.MouseListener, java.awt.event.MouseWheelListener, java.awt.event.MouseMotionListener
AwtMouseInput
Modifier and Type | Field and Description |
---|---|
static int |
WHEEL_AMP |
AXIS_WHEEL, AXIS_X, AXIS_Y, BUTTON_LEFT, BUTTON_MIDDLE, BUTTON_RIGHT
Constructor and Description |
---|
AwtMouseInput() |
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Ceases listening to events from the device.
|
int |
getButtonCount()
Returns the number of buttons the mouse has.
|
long |
getInputTimeNanos() |
void |
initialize()
Initializes the native side to listen into events from the device.
|
boolean |
isInitialized() |
void |
mouseClicked(java.awt.event.MouseEvent awtEvt) |
void |
mouseDragged(java.awt.event.MouseEvent awtEvt) |
void |
mouseEntered(java.awt.event.MouseEvent awtEvt) |
void |
mouseExited(java.awt.event.MouseEvent awtEvt) |
void |
mouseMoved(java.awt.event.MouseEvent awtEvt) |
void |
mousePressed(java.awt.event.MouseEvent awtEvt) |
void |
mouseReleased(java.awt.event.MouseEvent awtEvt) |
void |
mouseWheelMoved(java.awt.event.MouseWheelEvent awtEvt) |
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 |
setInputSource(java.awt.Component comp) |
void |
setNativeCursor(JmeCursor cursor)
Sets the cursor to use.
|
void |
update()
Queries the device for input.
|
public void setInputSource(java.awt.Component comp)
public void initialize()
Input
initialize
in interface Input
public void destroy()
Input
public boolean isInitialized()
isInitialized
in interface Input
Input.initialize()
,
Input.destroy()
public void setInputListener(RawInputListener listener)
Input
setInputListener
in interface Input
public long getInputTimeNanos()
getInputTimeNanos
in interface Input
public void setCursorVisible(boolean visible)
MouseInput
setCursorVisible
in interface MouseInput
visible
- Whether the mouse cursor should be visible or not.public void update()
Input
update
in interface Input
Input.setInputListener(com.jme3.input.RawInputListener)
public int getButtonCount()
MouseInput
getButtonCount
in interface MouseInput
public void mouseClicked(java.awt.event.MouseEvent awtEvt)
mouseClicked
in interface java.awt.event.MouseListener
public void mousePressed(java.awt.event.MouseEvent awtEvt)
mousePressed
in interface java.awt.event.MouseListener
public void mouseReleased(java.awt.event.MouseEvent awtEvt)
mouseReleased
in interface java.awt.event.MouseListener
public void mouseEntered(java.awt.event.MouseEvent awtEvt)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent awtEvt)
mouseExited
in interface java.awt.event.MouseListener
public void mouseWheelMoved(java.awt.event.MouseWheelEvent awtEvt)
mouseWheelMoved
in interface java.awt.event.MouseWheelListener
public void mouseDragged(java.awt.event.MouseEvent awtEvt)
mouseDragged
in interface java.awt.event.MouseMotionListener
public void mouseMoved(java.awt.event.MouseEvent awtEvt)
mouseMoved
in interface java.awt.event.MouseMotionListener
public void setNativeCursor(JmeCursor cursor)
MouseInput
setNativeCursor
in interface MouseInput
cursor
- The cursor to use.