| Constructor and Description |
|---|
LibgdxInput() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
axisMoved(com.badlogic.gdx.controllers.Controller controller,
int axisCode,
float value) |
boolean |
buttonDown(com.badlogic.gdx.controllers.Controller controller,
int buttonCode) |
boolean |
buttonUp(com.badlogic.gdx.controllers.Controller controller,
int buttonCode) |
void |
connected(com.badlogic.gdx.controllers.Controller controller) |
void |
disconnected(com.badlogic.gdx.controllers.Controller controller) |
java.lang.String |
getClipboardContents()
Returns the clipboard contents.
|
org.mini2Dx.gdx.utils.Array<GamePad> |
getGamePads()
Returns the list of known
GamePads connected to the device. |
int |
getX()
Returns the mouse/touch screen X coordinate
|
int |
getY()
Returns the mouse/touch screen Y coordinate
|
boolean |
hasClipboardContents()
Returns if the clipboard has contents.
|
boolean |
isClipboardSupported()
Returns if the clipboard is supported by the current platform.
|
boolean |
isKeyDown(int key)
Returns if a keyboard key is down
|
boolean |
isKeyJustPressed(int key)
Returns if a keyboard key was just pressed (down, then released)
|
boolean |
isKeyUp(int key)
Returns if a keyboard key is up
|
boolean |
justTouched()
Returns if the the screen was just touched or the mouse was just clicked
|
PS4GamePad |
newPS4GamePad(GamePad gamePad)
Wraps a
GamePad as a PS4GamePad |
SwitchDualJoyConGamePad |
newSwitchDualJoyConGamePad(GamePad gamePad)
Wraps a
GamePad as a SwitchDualJoyConGamePad |
SwitchJoyConLGamePad |
newSwitchJoyConLGamePad(GamePad gamePad)
Wraps a
GamePad as a SwitchJoyConLGamePad |
SwitchJoyConRGamePad |
newSwitchJoyConRGamePad(GamePad gamePad)
Wraps a
GamePad as a SwitchJoyConRGamePad |
XboxGamePad |
newXboxGamePad(GamePad gamePad)
Wraps a
GamePad as a XboxGamePad |
void |
setClipboardContents(java.lang.String contents)
Sets the clipboard contents.
|
void |
setGamePadConnectionListener(GamePadConnectionListener listener,
boolean notifyExisting)
Sets the
GamePadConnectionListener for handling GamePad connects/disconnects |
void |
setInputProcessor(org.mini2Dx.gdx.InputProcessor inputProcessor)
Sets the
InputProcessor for handling mouse/keyboard/touch events |
void |
setOnScreenKeyboardVisible(boolean visible)
Sets on mobile and consoles of the on-screen keyboard should appear.
|
void |
updateGamePads() |
public void updateGamePads()
public void setInputProcessor(org.mini2Dx.gdx.InputProcessor inputProcessor)
InputInputProcessor for handling mouse/keyboard/touch eventssetInputProcessor in interface InputinputProcessor - The InputProcessor to usepublic void setGamePadConnectionListener(GamePadConnectionListener listener, boolean notifyExisting)
InputGamePadConnectionListener for handling GamePad connects/disconnectssetGamePadConnectionListener in interface Inputlistener - The GamePadConnectionListener to usenotifyExisting - True if the listener should receive a GamePadConnectionListener.onConnect(GamePad) call for existing controllers connectedpublic void setOnScreenKeyboardVisible(boolean visible)
InputInput.Keys.ESCAPE is sent when the keyboard is closed.setOnScreenKeyboardVisible in interface Inputvisible - True if the keyboard should appearpublic org.mini2Dx.gdx.utils.Array<GamePad> getGamePads()
InputGamePads connected to the device.getGamePads in interface InputArray if no GamePads are present.public PS4GamePad newPS4GamePad(GamePad gamePad)
InputGamePad as a PS4GamePadnewPS4GamePad in interface InputgamePad - The underlying GamePad instancePS4GamePadpublic SwitchDualJoyConGamePad newSwitchDualJoyConGamePad(GamePad gamePad)
InputGamePad as a SwitchDualJoyConGamePadnewSwitchDualJoyConGamePad in interface InputgamePad - The underlying GamePad instanceSwitchDualJoyConGamePadpublic SwitchJoyConLGamePad newSwitchJoyConLGamePad(GamePad gamePad)
InputGamePad as a SwitchJoyConLGamePadnewSwitchJoyConLGamePad in interface InputgamePad - The underlying GamePad instanceSwitchJoyConLGamePadpublic SwitchJoyConRGamePad newSwitchJoyConRGamePad(GamePad gamePad)
InputGamePad as a SwitchJoyConRGamePadnewSwitchJoyConRGamePad in interface InputgamePad - The underlying GamePad instanceSwitchJoyConRGamePadpublic XboxGamePad newXboxGamePad(GamePad gamePad)
InputGamePad as a XboxGamePadnewXboxGamePad in interface InputgamePad - The underlying GamePad instanceXboxGamePadpublic int getX()
Inputpublic int getY()
Inputpublic boolean isKeyJustPressed(int key)
InputisKeyJustPressed in interface Inputkey - The keyboard keycodepublic boolean isKeyDown(int key)
Inputpublic boolean isKeyUp(int key)
Inputpublic boolean justTouched()
InputjustTouched in interface Inputpublic boolean isClipboardSupported()
InputisClipboardSupported in interface Inputpublic boolean hasClipboardContents()
InputInput.getClipboardContents() to
prevent triggering unwanted clipboard access notifications (iOS >= 14)hasClipboardContents in interface Inputpublic java.lang.String getClipboardContents()
InputgetClipboardContents in interface Inputpublic void setClipboardContents(java.lang.String contents)
InputsetClipboardContents in interface Inputcontents - Clipboard contents to be setpublic void connected(com.badlogic.gdx.controllers.Controller controller)
connected in interface com.badlogic.gdx.controllers.ControllerListenerpublic void disconnected(com.badlogic.gdx.controllers.Controller controller)
disconnected in interface com.badlogic.gdx.controllers.ControllerListenerpublic boolean buttonDown(com.badlogic.gdx.controllers.Controller controller,
int buttonCode)
buttonDown in interface com.badlogic.gdx.controllers.ControllerListenerpublic boolean buttonUp(com.badlogic.gdx.controllers.Controller controller,
int buttonCode)
buttonUp in interface com.badlogic.gdx.controllers.ControllerListenerpublic boolean axisMoved(com.badlogic.gdx.controllers.Controller controller,
int axisCode,
float value)
axisMoved in interface com.badlogic.gdx.controllers.ControllerListener