public final class MouseAwt extends Object implements Mouse
Constructor and Description |
---|
MouseAwt()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addActionPressed(int click,
EventAction action)
Add an action that will be triggered on pressed state.
|
void |
addActionReleased(int click,
EventAction action)
Add an action that will be triggered on released state.
|
void |
doClick(int click)
Perform a click.
|
void |
doClickAt(int click,
int x,
int y)
Perform a click at specified coordinate.
|
void |
doMoveMouse(int x,
int y)
Move mouse.
|
void |
doSetMouse(int x,
int y)
Teleport mouse without move.
|
int |
getClick() |
int |
getMoveX() |
int |
getMoveY() |
int |
getOnScreenX()
Get location on screen x.
|
int |
getOnScreenY()
Get location on screen y.
|
int |
getX() |
int |
getY() |
boolean |
hasClicked(int click) |
boolean |
hasClickedOnce(int click) |
boolean |
hasMoved() |
void |
lock()
Lock mouse at its center.
|
void |
lock(int x,
int y)
Lock mouse at specified location.
|
void |
setCenter(int x,
int y)
Set mouse center for lock operation.
|
void |
setConfig(Config config)
Set the config.
|
void |
update(double extrp) |
public void setConfig(Config config)
config
- The config.public void addActionPressed(int click, EventAction action)
Mouse
Alternative usage with classic programming style can be achieved with InputDevicePointer.hasClicked(int)
or
InputDevicePointer.hasClickedOnce(int)
.
addActionPressed
in interface Mouse
click
- The action key.action
- The action reference.public void addActionReleased(int click, EventAction action)
Mouse
Alternative usage with classic programming style can be achieved with InputDevicePointer.hasClicked(int)
or
InputDevicePointer.hasClickedOnce(int)
.
addActionReleased
in interface Mouse
click
- The action key.action
- The action reference.public void lock()
Mouse
public void lock(int x, int y)
Mouse
public void doClick(int click)
Mouse
public void doSetMouse(int x, int y)
Mouse
doSetMouse
in interface Mouse
x
- The location x.y
- The location y.public void doMoveMouse(int x, int y)
Mouse
doMoveMouse
in interface Mouse
x
- The location x.y
- The location y.public void doClickAt(int click, int x, int y)
Mouse
public void setCenter(int x, int y)
Mouse
public int getOnScreenX()
Mouse
getOnScreenX
in interface Mouse
public int getOnScreenY()
Mouse
getOnScreenY
in interface Mouse
public int getX()
getX
in interface InputDevicePointer
public int getY()
getY
in interface InputDevicePointer
public int getMoveX()
getMoveX
in interface InputDevicePointer
public int getMoveY()
getMoveY
in interface InputDevicePointer
public int getClick()
getClick
in interface InputDevicePointer
public boolean hasClicked(int click)
hasClicked
in interface InputDevicePointer
public boolean hasClickedOnce(int click)
hasClickedOnce
in interface InputDevicePointer
public boolean hasMoved()
hasMoved
in interface InputDevicePointer
Copyright © 2017 Byron 3D Games Studio. All rights reserved.