APIdia Launch Partner
Top Description Fields Constructors Methods
com.badlogic.gdx.input

public Class RemoteSender

extends Object
implements InputProcessor
Class Inheritance
All Implemented Interfaces
com.badlogic.gdx.InputProcessor
Imports
java.io.DataOutputStream, java.net.Socket, com.badlogic.gdx.Gdx, .Input.Peripheral, .InputProcessor

Sends all inputs from touch, key, accelerometer and compass to a RemoteInput at the given ip/port. Instantiate this and call sendUpdate() periodically.
Author
mzechner

Field Summary

Modifier and TypeField and Description
public static final int
public static final int
private boolean
public static final int
public static final int
public static final int
public static final int
private DataOutputStream
public static final int
public static final int
public static final int
public static final int

Constructor Summary

AccessConstructor and Description
public
RemoteSender(String ip, int port)

Method Summary

Modifier and TypeMethod and Description
public boolean
public boolean
keyDown(int keycode)

Implements com.badlogic.gdx.InputProcessor.keyDown.

Called when a key was pressed

public boolean
keyTyped(char character)

Implements com.badlogic.gdx.InputProcessor.keyTyped.

Called when a key was typed

public boolean
keyUp(int keycode)

Implements com.badlogic.gdx.InputProcessor.keyUp.

Called when a key was released

public boolean
mouseMoved(int x, int y)

Implements com.badlogic.gdx.InputProcessor.mouseMoved.

Called when the mouse was moved without any buttons being pressed.

public boolean
scrolled(float amountX, float amountY)

Implements com.badlogic.gdx.InputProcessor.scrolled.

Called when the mouse wheel was scrolled.

public void
public boolean
touchCancelled(int screenX, int screenY, int pointer, int button)

Implements com.badlogic.gdx.InputProcessor.touchCancelled.

Called when the touch gesture is cancelled.

public boolean
touchDown(int x, int y, int pointer, int button)

Implements com.badlogic.gdx.InputProcessor.touchDown.

Called when the screen was touched or a mouse button was pressed.

public boolean
touchDragged(int x, int y, int pointer)

Implements com.badlogic.gdx.InputProcessor.touchDragged.

Called when a finger or the mouse was dragged.

public boolean
touchUp(int x, int y, int pointer, int button)

Implements com.badlogic.gdx.InputProcessor.touchUp.

Called when a finger was lifted or a mouse button was released.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ACCELback to summary
public static final int ACCEL
COMPASSback to summary
public static final int COMPASS
connectedback to summary
private boolean connected
GYROback to summary
public static final int GYRO
KEY_DOWNback to summary
public static final int KEY_DOWN
KEY_TYPEDback to summary
public static final int KEY_TYPED
KEY_UPback to summary
public static final int KEY_UP
outback to summary
private DataOutputStream out
SIZEback to summary
public static final int SIZE
TOUCH_DOWNback to summary
public static final int TOUCH_DOWN
TOUCH_DRAGGEDback to summary
public static final int TOUCH_DRAGGED
TOUCH_UPback to summary
public static final int TOUCH_UP

Constructor Detail

RemoteSenderback to summary
public RemoteSender(String ip, int port)

Method Detail

isConnectedback to summary
public boolean isConnected()
keyDownback to summary
public boolean keyDown(int keycode)

Implements com.badlogic.gdx.InputProcessor.keyDown.

Doc from com.badlogic.gdx.InputProcessor.keyDown.

Called when a key was pressed

Annotations
@Override
keyTypedback to summary
public boolean keyTyped(char character)

Implements com.badlogic.gdx.InputProcessor.keyTyped.

Doc from com.badlogic.gdx.InputProcessor.keyTyped.

Called when a key was typed

Annotations
@Override
keyUpback to summary
public boolean keyUp(int keycode)

Implements com.badlogic.gdx.InputProcessor.keyUp.

Doc from com.badlogic.gdx.InputProcessor.keyUp.

Called when a key was released

Annotations
@Override
mouseMovedback to summary
public boolean mouseMoved(int x, int y)

Implements com.badlogic.gdx.InputProcessor.mouseMoved.

Doc from com.badlogic.gdx.InputProcessor.mouseMoved.

Called when the mouse was moved without any buttons being pressed. Will not be called on iOS.

Annotations
@Override
scrolledback to summary
public boolean scrolled(float amountX, float amountY)

Implements com.badlogic.gdx.InputProcessor.scrolled.

Doc from com.badlogic.gdx.InputProcessor.scrolled.

Called when the mouse wheel was scrolled. Will not be called on iOS.

Annotations
@Override
sendUpdateback to summary
public void sendUpdate()
touchCancelledback to summary
public boolean touchCancelled(int screenX, int screenY, int pointer, int button)

Implements com.badlogic.gdx.InputProcessor.touchCancelled.

Doc from com.badlogic.gdx.InputProcessor.touchCancelled.

Called when the touch gesture is cancelled. Reason may be from OS interruption to touch becoming a large surface such as the user cheek). Relevant on Android and iOS only. The button parameter will be Buttons#LEFT on iOS.

Annotations
@Override
touchDownback to summary
public boolean touchDown(int x, int y, int pointer, int button)

Implements com.badlogic.gdx.InputProcessor.touchDown.

Doc from com.badlogic.gdx.InputProcessor.touchDown.

Called when the screen was touched or a mouse button was pressed. The button parameter will be Buttons#LEFT on iOS.

Annotations
@Override
touchDraggedback to summary
public boolean touchDragged(int x, int y, int pointer)

Implements com.badlogic.gdx.InputProcessor.touchDragged.

Doc from com.badlogic.gdx.InputProcessor.touchDragged.

Called when a finger or the mouse was dragged.

Annotations
@Override
touchUpback to summary
public boolean touchUp(int x, int y, int pointer, int button)

Implements com.badlogic.gdx.InputProcessor.touchUp.

Doc from com.badlogic.gdx.InputProcessor.touchUp.

Called when a finger was lifted or a mouse button was released. The button parameter will be Buttons#LEFT on iOS.

Annotations
@Override