APIdia Launch Partner
Top Inners Fields Constructors Methods
com.badlogic.gdx.backends.lwjgl

public Class LwjglAWTInput

extends AbstractInput
implements MouseMotionListener, MouseListener, MouseWheelListener, KeyListener
Class Inheritance
All Implemented Interfaces
java.awt.event.KeyListener, java.util.EventListener, java.awt.event.MouseWheelListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener
Imports
java.awt.AWTException, .Canvas, .Color, .Component, .Container, .Cursor, .FlowLayout, .GraphicsEnvironment, .HeadlessException, .Image, .Point, .Robot, .Toolkit, java.awt.event.KeyListener, .MouseEvent, .MouseListener, .MouseMotionListener, .MouseWheelEvent, .MouseWheelListener, .WindowEvent, .WindowFocusListener, java.awt.image.BufferedImage, java.util.ArrayList, .List, javax.swing.JDialog, .JFrame, .JLabel, .JOptionPane, .JPanel, .JTextField, .OverlayLayout, .SwingUtilities, javax.swing.border.Border, .EmptyBorder, javax.swing.event.DocumentEvent, .DocumentListener, com.badlogic.gdx.AbstractInput, .Input, .InputProcessor, com.badlogic.gdx.input.NativeInputConfiguration, com.badlogic.gdx.utils.IntSet, .Pool

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class
pack-priv class

Field Summary

Modifier and TypeField and Description
pack-priv Canvas
pack-priv boolean
pack-priv long
pack-priv int
pack-priv int
pack-priv boolean[]
pack-priv boolean
pack-priv List<LwjglAWTInput.KeyEvent>
private final LwjglAWTCanvas
pack-priv IntSet
pack-priv InputProcessor
pack-priv Robot
pack-priv boolean
pack-priv List<LwjglAWTInput.TouchEvent>
pack-priv int
pack-priv int
pack-priv Pool<LwjglAWTInput.KeyEvent>
pack-priv Pool<LwjglAWTInput.TouchEvent>
Inherited from com.badlogic.gdx.AbstractInput:
justPressedKeyskeyJustPressedpressedKeyCountpressedKeys

Constructor Summary

AccessConstructor and Description
public
LwjglAWTInput(LwjglAWTCanvas lwjglAwtCanvas)

Method Summary

Modifier and TypeMethod and Description
private void
public void
closeTextInputField(boolean sendReturn)

Overrides default com.badlogic.gdx.Input.closeTextInputField.

Closes the native input field and applies the result to the input wrapper.

protected static JFrame
findJFrame(Component component)

public float
public float
public float
public float
getAzimuth()

Implements com.badlogic.gdx.Input.getAzimuth.

The azimuth is the angle of the device's orientation around the z-axis.

public long
public int
public int
public int
public int
public float
public float
public float
public InputProcessor
public int
public Input.Orientation
public float
getPitch()

Implements com.badlogic.gdx.Input.getPitch.

The pitch is the angle of the device's orientation around the x-axis.

public float
public float
getPressure(int pointer)

Implements com.badlogic.gdx.Input.getPressure.

Returns the pressure of the given pointer, where 0 is untouched.

public float
getRoll()

Implements com.badlogic.gdx.Input.getRoll.

The roll is the angle of the device's orientation around the y-axis.

public int
public void
getRotationMatrix(float[] matrix)

Implements com.badlogic.gdx.Input.getRotationMatrix.

Returns the rotation matrix describing the devices rotation as per SensorManager#getRotationMatrix(float[], float[], float[], float[]).

public void
getTextInput(Input.TextInputListener listener, String title, String text, String hint)

Implements com.badlogic.gdx.Input.getTextInput.

System dependent method to input a string of text.

public void
getTextInput(final Input.TextInputListener listener, final String title, final String text, final String hint, Input.OnscreenKeyboardType type)

Implements com.badlogic.gdx.Input.getTextInput.

System dependent method to input a string of text.

public int
public int
getX(int pointer)

Implements com.badlogic.gdx.Input.getX.

Returns the x coordinate in screen coordinates of the given pointer.

public int
public int
getY(int pointer)

Implements com.badlogic.gdx.Input.getY.

Returns the y coordinate in screen coordinates of the given pointer.

public boolean
isButtonJustPressed(int button)

Implements com.badlogic.gdx.Input.isButtonJustPressed.

Returns whether a given button has just been pressed.

public boolean
isButtonPressed(int button)

Implements com.badlogic.gdx.Input.isButtonPressed.

Whether a given button is pressed or not.

public boolean
public synchronized boolean
isKeyJustPressed(int key)

Overrides com.badlogic.gdx.AbstractInput.isKeyJustPressed.

Implements com.badlogic.gdx.Input.isKeyJustPressed.

Returns whether the key has just been pressed.

public synchronized boolean
isKeyPressed(int key)

Overrides com.badlogic.gdx.AbstractInput.isKeyPressed.

Implements com.badlogic.gdx.Input.isKeyPressed.

Returns whether the key is pressed.

public boolean
isPeripheralAvailable(Input.Peripheral peripheral)

Implements com.badlogic.gdx.Input.isPeripheralAvailable.

Queries whether a Peripheral is currently available.

public boolean
public boolean
isTouched(int pointer)

Implements com.badlogic.gdx.Input.isTouched.

Whether the screen is currently touched by the pointer with the given index.

public boolean
public void
keyPressed(KeyEvent e)

Implements java.awt.event.KeyListener.keyPressed.

Invoked when a key has been pressed.

public void
keyReleased(KeyEvent e)

Implements java.awt.event.KeyListener.keyReleased.

Invoked when a key has been released.

public void
keyTyped(KeyEvent e)

Implements java.awt.event.KeyListener.keyTyped.

Invoked when a key has been typed.

public void
mouseClicked(MouseEvent arg0)

Implements java.awt.event.MouseListener.mouseClicked.

Invoked when the mouse button has been clicked (pressed and released) on a component.

public void
mouseDragged(MouseEvent e)

Implements java.awt.event.MouseMotionListener.mouseDragged.

Invoked when a mouse button is pressed on a component and then dragged.

public void
mouseEntered(MouseEvent e)

Implements java.awt.event.MouseListener.mouseEntered.

Invoked when the mouse enters a component.

public void
mouseExited(MouseEvent e)

Implements java.awt.event.MouseListener.mouseExited.

Invoked when the mouse exits a component.

public void
mouseMoved(MouseEvent e)

Implements java.awt.event.MouseMotionListener.mouseMoved.

Invoked when the mouse cursor has been moved onto a component but no buttons have been pushed.

public void
mousePressed(MouseEvent e)

Implements java.awt.event.MouseListener.mousePressed.

Invoked when a mouse button has been pressed on a component.

public void
mouseReleased(MouseEvent e)

Implements java.awt.event.MouseListener.mouseReleased.

Invoked when a mouse button has been released on a component.

public void
mouseWheelMoved(MouseWheelEvent e)

Implements java.awt.event.MouseWheelListener.mouseWheelMoved.

Invoked when the mouse wheel is rotated.

public void
openTextInputField(NativeInputConfiguration configuration)

Implements com.badlogic.gdx.Input.openTextInputField.

Sets the on-screen keyboard visible if available.

pack-priv void
public void
setCursorCatched(boolean catched)

Implements com.badlogic.gdx.Input.setCursorCatched.

Only viable on the desktop.

public void
setCursorPosition(int x, int y)

Implements com.badlogic.gdx.Input.setCursorPosition.

Only viable on the desktop.

public void
setInputProcessor(InputProcessor processor)

Implements com.badlogic.gdx.Input.setInputProcessor.

Sets the InputProcessor that will receive all touch and key input events.

public void
setKeyboardHeightObserver(Input.KeyboardHeightObserver observer)

Implements com.badlogic.gdx.Input.setKeyboardHeightObserver.

This will set a keyboard height callback.

public void
public void
setOnscreenKeyboardVisible(boolean visible)

Implements com.badlogic.gdx.Input.setOnscreenKeyboardVisible.

Sets the on-screen keyboard visible if available.

public void
setOnscreenKeyboardVisible(boolean visible, Input.OnscreenKeyboardType type)

Implements com.badlogic.gdx.Input.setOnscreenKeyboardVisible.

Sets the on-screen keyboard visible if available.

private void
showCursor(boolean visible)

private int
toGdxButton(int swingButton)

protected int
translateKeyCode(int keyCode)

public void
vibrate(int milliseconds)

Implements com.badlogic.gdx.Input.vibrate.

Generates a simple haptic effect of a given duration or a vibration effect on devices without haptic capabilities.

public void
vibrate(int milliseconds, boolean fallback)

Implements com.badlogic.gdx.Input.vibrate.

Generates a simple haptic effect of a given duration and default amplitude.

public void
vibrate(int milliseconds, int amplitude, boolean fallback)

Implements com.badlogic.gdx.Input.vibrate.

Generates a simple haptic effect of a given duration and amplitude.

public void
vibrate(Input.VibrationType vibrationType)

Implements com.badlogic.gdx.Input.vibrate.

Generates a simple haptic effect of a type.

Inherited from com.badlogic.gdx.AbstractInput:
isCatchKeysetCatchKey