public class RemoteSender extends java.lang.Object implements InputProcessor
RemoteInput at the given ip/port. Instantiate this and
call sendUpdate() periodically.| Modifier and Type | Field and Description |
|---|---|
static int |
ACCEL |
static int |
COMPASS |
static int |
GYRO |
static int |
KEY_DOWN |
static int |
KEY_TYPED |
static int |
KEY_UP |
static int |
SIZE |
static int |
TOUCH_DOWN |
static int |
TOUCH_DRAGGED |
static int |
TOUCH_UP |
| Constructor and Description |
|---|
RemoteSender(java.lang.String ip,
int port) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isConnected() |
boolean |
keyDown(int keycode)
Called when a key was pressed
|
boolean |
keyTyped(char character)
Called when a key was typed
|
boolean |
keyUp(int keycode)
Called when a key was released
|
boolean |
mouseMoved(int x,
int y)
Called when the mouse was moved without any buttons being pressed.
|
boolean |
scrolled(int amount)
Called when the mouse wheel was scrolled.
|
void |
sendUpdate() |
boolean |
touchDown(int x,
int y,
int pointer,
int button)
Called when the screen was touched or a mouse button was pressed.
|
boolean |
touchDragged(int x,
int y,
int pointer)
Called when a finger or the mouse was dragged.
|
boolean |
touchUp(int x,
int y,
int pointer,
int button)
Called when a finger was lifted or a mouse button was released.
|
public static final int KEY_DOWN
public static final int KEY_UP
public static final int KEY_TYPED
public static final int TOUCH_DOWN
public static final int TOUCH_UP
public static final int TOUCH_DRAGGED
public static final int ACCEL
public static final int COMPASS
public static final int SIZE
public static final int GYRO
public void sendUpdate()
public boolean keyDown(int keycode)
InputProcessorkeyDown in interface InputProcessorkeycode - one of the constants in Input.Keyspublic boolean keyUp(int keycode)
InputProcessorkeyUp in interface InputProcessorkeycode - one of the constants in Input.Keyspublic boolean keyTyped(char character)
InputProcessorkeyTyped in interface InputProcessorcharacter - The characterpublic boolean touchDown(int x,
int y,
int pointer,
int button)
InputProcessorInput.Buttons.LEFT on iOS.touchDown in interface InputProcessorx - The x coordinate, origin is in the upper left cornery - The y coordinate, origin is in the upper left cornerpointer - the pointer for the event.button - the buttonpublic boolean touchUp(int x,
int y,
int pointer,
int button)
InputProcessorInput.Buttons.LEFT on iOS.touchUp in interface InputProcessorpointer - the pointer for the event.button - the buttonpublic boolean touchDragged(int x,
int y,
int pointer)
InputProcessortouchDragged in interface InputProcessorpointer - the pointer for the event.public boolean mouseMoved(int x,
int y)
InputProcessormouseMoved in interface InputProcessorpublic boolean scrolled(int amount)
InputProcessorscrolled in interface InputProcessoramount - the scroll amount, -1 or 1 depending on the direction the wheel was scrolled.public boolean isConnected()