Class AWTInput
java.lang.Object
nl.colorize.multimedialib.renderer.java2d.AWTInput
- All Implemented Interfaces:
KeyListener,MouseListener,MouseMotionListener,EventListener,InputDevice,Updatable
public class AWTInput
extends Object
implements InputDevice, KeyListener, MouseListener, MouseMotionListener
Input device that uses AWT to capture mouse and keyboard events.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidClears 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(int keycode) booleanisKeyPressed(KeyCode keyCode) Returns true if the key with the specified key code was pressed during the current frame.booleanisKeyReleased(int keycode) booleanisKeyReleased(KeyCode keyCode) Returns true if the key with the specified key code was released during the current frame.booleanvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidnl.colorize.util.Subject<String> requestTextInput(String labelText, String initialValue) Shows a dialog window with a text input field.voidupdate(float deltaTime) Copies all events that have been received during the last frame to this class' internal state.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
-
AWTInput
-
-
Method Details
-
update
public void update(float deltaTime) Copies all events that have been received during the last frame to this class' internal state. This method must be called every frame. -
keyPressed
- Specified by:
keyPressedin interfaceKeyListener
-
keyReleased
- Specified by:
keyReleasedin interfaceKeyListener
-
keyTyped
- Specified by:
keyTypedin interfaceKeyListener
-
mousePressed
- Specified by:
mousePressedin interfaceMouseListener
-
mouseReleased
- Specified by:
mouseReleasedin interfaceMouseListener
-
mouseClicked
- Specified by:
mouseClickedin interfaceMouseListener
-
mouseEntered
- Specified by:
mouseEnteredin interfaceMouseListener
-
mouseExited
- Specified by:
mouseExitedin interfaceMouseListener
-
mouseMoved
- Specified by:
mouseMovedin interfaceMouseMotionListener
-
mouseDragged
- Specified by:
mouseDraggedin interfaceMouseMotionListener
-
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
-
isKeyPressed
public boolean isKeyPressed(int keycode) -
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
-
isKeyReleased
public boolean isKeyReleased(int keycode) -
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
-