Package arc.backend.robovm
Class IOSInput
java.lang.Object
arc.Input
arc.backend.robovm.IOSInput
-
Nested Class Summary
Nested classes/interfaces inherited from class arc.Input
Input.Orientation, Input.Peripheral, Input.TextInput
-
Field Summary
Fields inherited from class arc.Input
caughtKeys, devices, inputMultiplexer, keyboard, mouseReturn, useKeyboard
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
deltaX()
int
deltaX
(int pointer) int
deltaY()
int
deltaY
(int pointer) long
org.robovm.apple.uikit.UITextField
float
float
getPressure
(int pointer) Returns the pressure of the given pointer, where 0 is untouched.int
void
getTextInput
(Input.TextInput input) System dependent method to input a string of text.boolean
isPeripheralAvailable
(Input.Peripheral peripheral) Queries whether aInput.Peripheral
is currently available.boolean
boolean
isTouched
(int pointer) Whether the screen is currently touched by the pointer with the given index.boolean
int
mouseX()
int
mouseX
(int pointer) Returns the x coordinate in screen coordinates of the given pointer.int
mouseY()
int
mouseY
(int pointer) Returns the y coordinate in screen coordinates of the given pointer.protected void
onTouch
(long touches) void
setKeyboardCloseOnReturnKey
(boolean shouldClose) Set the keyboard to close when the UITextField return key is pressedvoid
setOnscreenKeyboardVisible
(boolean visible) Sets the on-screen keyboard visible if available.protected void
void
vibrate
(int milliseconds) Vibrates for the given amount of time.Methods inherited from class arc.Input
addProcessor, alt, axis, axis, axisTap, cancelVibrate, ctrl, getDevices, getGyroscope, getInputMultiplexer, getInputProcessors, getKeyboard, getOrientation, getRotationMatrix, getTouches, isCatch, keyDown, keyDown, keyRelease, keyRelease, keyTap, keyTap, mouse, mouseScreen, mouseWorld, mouseWorld, mouseWorldX, mouseWorldY, removeProcessor, setCatch, setUseKeyboard, shift, useKeyboard, vibrate
-
Field Details
-
accelerometerDelegate
-
-
Constructor Details
-
IOSInput
-
-
Method Details
-
setupAccelerometer
protected void setupAccelerometer() -
getAccelerometer
- Overrides:
getAccelerometer
in classInput
- Returns:
- The acceleration force in m/s^2 applied to the device, including the force of gravity
-
mouseX
public int mouseX() -
mouseX
public int mouseX(int pointer) Description copied from class:Input
Returns the x coordinate in screen coordinates of the given pointer. Pointers are indexed from 0 to n. The pointer id identifies the order in which the fingers went down on the screen, e.g. 0 is the first finger, 1 is the second and so on. When two fingers are touched down and the first one is lifted the second one keeps its index. If another finger is placed on the touch screen the first free index will be used. -
deltaX
public int deltaX() -
deltaX
public int deltaX(int pointer) -
mouseY
public int mouseY() -
mouseY
public int mouseY(int pointer) Description copied from class:Input
Returns the y coordinate in screen coordinates of the given pointer. Pointers are indexed from 0 to n. The pointer id identifies the order in which the fingers went down on the screen, e.g. 0 is the first finger, 1 is the second and so on. When two fingers are touched down and the first one is lifted the second one keeps its index. If another finger is placed on the touch screen the first free index will be used. -
deltaY
public int deltaY() -
deltaY
public int deltaY(int pointer) -
isTouched
public boolean isTouched() -
justTouched
public boolean justTouched()- Specified by:
justTouched
in classInput
- Returns:
- whether a new touch down event just occurred.
-
isTouched
public boolean isTouched(int pointer) Description copied from class:Input
Whether the screen is currently touched by the pointer with the given index. Pointers are indexed from 0 to n. The pointer id identifies the order in which the fingers went down on the screen, e.g. 0 is the first finger, 1 is the second and so on. When two fingers are touched down and the first one is lifted the second one keeps its index. If another finger is placed on the touch screen the first free index will be used. -
getPressure
public float getPressure()- Overrides:
getPressure
in classInput
- Returns:
- the pressure of the first pointer
-
getPressure
public float getPressure(int pointer) Description copied from class:Input
Returns the pressure of the given pointer, where 0 is untouched. On Android it should be up to 1.0, but it can go above that slightly and its not consistent between devices. On iOS 1.0 is the normal touch and significantly more of hard touch. Check relevant manufacturer documentation for details. Check availability withInput.isPeripheralAvailable(Peripheral)
. If not supported, returns 1.0 when touched.- Overrides:
getPressure
in classInput
- Parameters:
pointer
- the pointer id.- Returns:
- the pressure
-
getTextInput
Description copied from class:Input
System dependent method to input a string of text. A dialog box will be created with the given title and the given text as a message for the user. Once the dialog has been closed the consumer be called on the rendering thread.- Overrides:
getTextInput
in classInput
-
setOnscreenKeyboardVisible
public void setOnscreenKeyboardVisible(boolean visible) Description copied from class:Input
Sets the on-screen keyboard visible if available. Only applicable on mobile.- Overrides:
setOnscreenKeyboardVisible
in classInput
- Parameters:
visible
- visible or not
-
setKeyboardCloseOnReturnKey
public void setKeyboardCloseOnReturnKey(boolean shouldClose) Set the keyboard to close when the UITextField return key is pressed- Parameters:
shouldClose
- Whether or not the keyboard should clsoe on return key press
-
getKeyboardTextField
public org.robovm.apple.uikit.UITextField getKeyboardTextField() -
vibrate
public void vibrate(int milliseconds) Description copied from class:Input
Vibrates for the given amount of time. Note that you'll need the permission<uses-permission android:name="android.permission.VIBRATE" />
in your manifest file in order for this to work. -
getCurrentEventTime
public long getCurrentEventTime()- Specified by:
getCurrentEventTime
in classInput
- Returns:
- the time of the event currently reported to the
InputProcessor
.
-
isPeripheralAvailable
Description copied from class:Input
Queries whether aInput.Peripheral
is currently available. In case of Android and theInput.Peripheral.hardwareKeyboard
this returns the whether the keyboard is currently slid out or not.- Overrides:
isPeripheralAvailable
in classInput
- Parameters:
peripheral
- theInput.Peripheral
- Returns:
- whether the peripheral is available or not.
-
getRotation
public int getRotation()- Overrides:
getRotation
in classInput
- Returns:
- the rotation of the device with respect to its native orientation.
-
getNativeOrientation
- Overrides:
getNativeOrientation
in classInput
- Returns:
- the native orientation of the device.
-
onTouch
protected void onTouch(long touches)
-