public class DefaultAndroidInput extends Object implements AndroidInput
Input.Buttons, Input.Keys, Input.OnscreenKeyboardType, Input.Orientation, Input.Peripheral, Input.TextInputListener| Modifier and Type | Field and Description |
|---|---|
boolean |
accelerometerAvailable |
boolean |
gyroscopeAvailable |
static int |
NUM_TOUCHES |
static int |
SUPPORTED_KEYS |
| Constructor and Description |
|---|
DefaultAndroidInput(Application activity,
android.content.Context context,
Object view,
AndroidApplicationConfiguration config) |
| Modifier and Type | Method and Description |
|---|---|
void |
addGenericMotionListener(android.view.View.OnGenericMotionListener listener)
Add a custom
View.OnGenericMotionListener |
void |
addKeyListener(android.view.View.OnKeyListener listener)
Add a custom
View.OnKeyListener |
void |
cancelVibrate() |
float |
getAccelerometerX() |
float |
getAccelerometerY() |
float |
getAccelerometerZ() |
static int |
getAndroidInputType(Input.OnscreenKeyboardType type) |
float |
getAzimuth() |
long |
getCurrentEventTime() |
int |
getDeltaX() |
int |
getDeltaX(int pointer) |
int |
getDeltaY() |
int |
getDeltaY(int pointer) |
int |
getFreePointerIndex() |
float |
getGyroscopeX() |
float |
getGyroscopeY() |
float |
getGyroscopeZ() |
InputProcessor |
getInputProcessor() |
int |
getMaxPointers() |
Input.Orientation |
getNativeOrientation() |
float |
getPitch() |
float |
getPressure() |
float |
getPressure(int pointer) |
float |
getRoll() |
int |
getRotation() |
void |
getRotationMatrix(float[] matrix)
Returns the rotation matrix describing the devices rotation as per SensorManager#getRotationMatrix(float[], float[], float[], float[]).
|
void |
getTextInput(Input.TextInputListener listener,
String title,
String text,
String hint) |
void |
getTextInput(Input.TextInputListener listener,
String title,
String text,
String hint,
Input.OnscreenKeyboardType keyboardType) |
int |
getX() |
int |
getX(int pointer) |
int |
getY() |
int |
getY(int pointer) |
boolean |
isButtonJustPressed(int button) |
boolean |
isButtonPressed(int button) |
boolean |
isCatchBackKey() |
boolean |
isCatchKey(int keycode) |
boolean |
isCatchMenuKey() |
boolean |
isCursorCatched() |
boolean |
isKeyJustPressed(int key) |
boolean |
isKeyPressed(int key) |
boolean |
isPeripheralAvailable(Input.Peripheral peripheral) |
boolean |
isTouched() |
boolean |
isTouched(int pointer) |
boolean |
justTouched() |
int |
lookUpPointerIndex(int pointerId) |
void |
onDreamingStarted()
Called when an
AndroidDaydream is about to start |
void |
onDreamingStopped()
Called when an
AndroidDaydream is about to stop |
boolean |
onGenericMotion(android.view.View view,
android.view.MotionEvent event) |
boolean |
onKey(android.view.View v,
int keyCode,
android.view.KeyEvent e) |
void |
onPause()
Called when the
AndroidApplication is about to pause |
void |
onResume()
Called when the
AndroidApplication is about to resume |
boolean |
onTouch(android.view.View view,
android.view.MotionEvent event) |
void |
processEvents()
Process all events (touch, key) that have been registered by the listeners so that event processing is synchronous.
|
void |
setCatchBackKey(boolean catchBack) |
void |
setCatchKey(int keycode,
boolean catchKey) |
void |
setCatchMenuKey(boolean catchMenu) |
void |
setCursorCatched(boolean catched) |
void |
setCursorPosition(int x,
int y) |
void |
setInputProcessor(InputProcessor processor) |
void |
setKeyboardAvailable(boolean available)
Shows/Hides soft screen keyboard
|
void |
setOnscreenKeyboardVisible(boolean visible) |
void |
setOnscreenKeyboardVisible(boolean visible,
Input.OnscreenKeyboardType type) |
void |
vibrate(int milliseconds) |
void |
vibrate(long[] pattern,
int repeat) |
public static final int NUM_TOUCHES
public static final int SUPPORTED_KEYS
public boolean accelerometerAvailable
public boolean gyroscopeAvailable
public DefaultAndroidInput(Application activity, android.content.Context context, Object view, AndroidApplicationConfiguration config)
public float getAccelerometerX()
getAccelerometerX in interface Inputpublic float getAccelerometerY()
getAccelerometerY in interface Inputpublic float getAccelerometerZ()
getAccelerometerZ in interface Inputpublic float getGyroscopeX()
getGyroscopeX in interface Inputpublic float getGyroscopeY()
getGyroscopeY in interface Inputpublic float getGyroscopeZ()
getGyroscopeZ in interface Inputpublic void getTextInput(Input.TextInputListener listener, String title, String text, String hint)
getTextInput in interface Inputpublic void getTextInput(Input.TextInputListener listener, String title, String text, String hint, Input.OnscreenKeyboardType keyboardType)
getTextInput in interface Inputpublic static int getAndroidInputType(Input.OnscreenKeyboardType type)
public int getMaxPointers()
getMaxPointers in interface Inputpublic float getPressure()
getPressure in interface Inputpublic float getPressure(int pointer)
getPressure in interface Inputpublic void setKeyboardAvailable(boolean available)
AndroidInputsetKeyboardAvailable in interface AndroidInputpublic boolean isKeyPressed(int key)
isKeyPressed in interface Inputpublic boolean isKeyJustPressed(int key)
isKeyJustPressed in interface Inputpublic void setInputProcessor(InputProcessor processor)
setInputProcessor in interface Inputpublic void processEvents()
AndroidInputprocessEvents in interface AndroidInputpublic boolean onTouch(android.view.View view,
android.view.MotionEvent event)
onTouch in interface android.view.View.OnTouchListenerpublic boolean onKey(android.view.View v,
int keyCode,
android.view.KeyEvent e)
onKey in interface android.view.View.OnKeyListenerpublic void setOnscreenKeyboardVisible(boolean visible)
setOnscreenKeyboardVisible in interface Inputpublic void setOnscreenKeyboardVisible(boolean visible,
Input.OnscreenKeyboardType type)
setOnscreenKeyboardVisible in interface Inputpublic void setCatchBackKey(boolean catchBack)
setCatchBackKey in interface Inputpublic boolean isCatchBackKey()
isCatchBackKey in interface Inputpublic void setCatchMenuKey(boolean catchMenu)
setCatchMenuKey in interface Inputpublic boolean isCatchMenuKey()
isCatchMenuKey in interface Inputpublic void setCatchKey(int keycode,
boolean catchKey)
setCatchKey in interface Inputpublic boolean isCatchKey(int keycode)
isCatchKey in interface Inputpublic void cancelVibrate()
cancelVibrate in interface Inputpublic boolean justTouched()
justTouched in interface Inputpublic boolean isButtonPressed(int button)
isButtonPressed in interface Inputpublic boolean isButtonJustPressed(int button)
isButtonJustPressed in interface Inputpublic void getRotationMatrix(float[] matrix)
getRotationMatrix in interface Inputmatrix - public float getAzimuth()
getAzimuth in interface Inputpublic InputProcessor getInputProcessor()
getInputProcessor in interface Inputpublic boolean isPeripheralAvailable(Input.Peripheral peripheral)
isPeripheralAvailable in interface Inputpublic int getFreePointerIndex()
public int lookUpPointerIndex(int pointerId)
public int getRotation()
getRotation in interface Inputpublic Input.Orientation getNativeOrientation()
getNativeOrientation in interface Inputpublic void setCursorCatched(boolean catched)
setCursorCatched in interface Inputpublic boolean isCursorCatched()
isCursorCatched in interface Inputpublic void setCursorPosition(int x,
int y)
setCursorPosition in interface Inputpublic long getCurrentEventTime()
getCurrentEventTime in interface Inputpublic void addKeyListener(android.view.View.OnKeyListener listener)
AndroidInputView.OnKeyListeneraddKeyListener in interface AndroidInputpublic boolean onGenericMotion(android.view.View view,
android.view.MotionEvent event)
onGenericMotion in interface android.view.View.OnGenericMotionListenerpublic void addGenericMotionListener(android.view.View.OnGenericMotionListener listener)
AndroidInputView.OnGenericMotionListeneraddGenericMotionListener in interface AndroidInputpublic void onPause()
AndroidInputAndroidApplication is about to pauseonPause in interface AndroidInputpublic void onResume()
AndroidInputAndroidApplication is about to resumeonResume in interface AndroidInputpublic void onDreamingStarted()
AndroidInputAndroidDaydream is about to startonDreamingStarted in interface AndroidInputpublic void onDreamingStopped()
AndroidInputAndroidDaydream is about to stoponDreamingStopped in interface AndroidInputCopyright © 2021. All rights reserved.