Class TeaInputDevice
java.lang.Object
nl.colorize.multimedialib.renderer.teavm.TeaInputDevice
- All Implemented Interfaces:
InputDevice,Updatable
Captures browser events for various input methods, and makes them accessible
from the animation loop. During each frame, incoming events are added to a
buffer. When the frame update takes place, the buffer is processed to determine
the current state for each input device.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidClears all pointer state for all currently active pointers.voidfillClipboard(String text) Copies the specified text to the system clipboard.Returns all currently active pointers.booleanbooleanisKeyPressed(KeyCode keyCode) Returns true if the key with the specified key code was pressed during the current frame.booleanisKeyReleased(KeyCode keyCode) Returns true if the key with the specified key code was released during the current frame.booleannl.colorize.util.Subject<String> requestTextInput(String label, String initialValue) Shows a dialog window with a text input field.voidreset()voidupdate(float deltaTime) Updates this object for the current frame.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface nl.colorize.multimedialib.renderer.InputDevice
isPointerPressed, isPointerReleased
-
Constructor Details
-
TeaInputDevice
-
-
Method Details
-
bindEventHandlers
public void bindEventHandlers() -
reset
public void reset() -
getPointers
Description copied from interface:InputDeviceReturns all currently active pointers. Depending on the current platform and device, pointers could be based on mouse input, a trackpad, or touch controls.Note that the type of pointer will also influence its behavior. The mouse pointer is always included in this list, since the mouse cursor is always visible. Touch pointer are only available during the touch, as the pointer disappears once the touch event has ended.
- Specified by:
getPointersin interfaceInputDevice
-
clearPointerState
public void clearPointerState()Description copied from interface:InputDeviceClears all pointer state for all currently active pointers. Using this method is the equivalent of usingPointer.clearState()on all pointers.- Specified by:
clearPointerStatein interfaceInputDevice
-
isTouchAvailable
public boolean isTouchAvailable()- Specified by:
isTouchAvailablein interfaceInputDevice
-
isKeyboardAvailable
public boolean isKeyboardAvailable()- Specified by:
isKeyboardAvailablein interfaceInputDevice
-
isKeyPressed
Description copied from interface:InputDeviceReturns true if the key with the specified key code was pressed during the current frame.- Specified by:
isKeyPressedin interfaceInputDevice
-
isKeyReleased
Description copied from interface:InputDeviceReturns true if the key with the specified key code was released during the current frame.- Specified by:
isKeyReleasedin interfaceInputDevice
-
requestTextInput
Description copied from interface:InputDeviceShows a dialog window with a text input field. The dialog window is not part of the scene, it uses the platform's native user interface.- Specified by:
requestTextInputin interfaceInputDevice
-
fillClipboard
Description copied from interface:InputDeviceCopies the specified text to the system clipboard.- Specified by:
fillClipboardin interfaceInputDevice
-
update
public void update(float deltaTime) Description copied from interface:UpdatableUpdates this object for the current frame.deltaTimeindicates the elapsed time since the last frame update, in seconds.
-