Package com.github.tommyettinger.textra
Class TextraField.TextFieldClickListener
java.lang.Object
com.badlogic.gdx.scenes.scene2d.InputListener
com.badlogic.gdx.scenes.scene2d.utils.ClickListener
com.github.tommyettinger.textra.TextraField.TextFieldClickListener
- All Implemented Interfaces:
com.badlogic.gdx.scenes.scene2d.EventListener
- Enclosing class:
- TextraField
public class TextraField.TextFieldClickListener
extends com.badlogic.gdx.scenes.scene2d.utils.ClickListener
Basic input listener for the TextraField
-
Field Summary
Fields inherited from class com.badlogic.gdx.scenes.scene2d.utils.ClickListener
visualPressedDuration
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
checkFocusTraversal
(char character) Checks if focus traversal should be triggered.void
clicked
(com.badlogic.gdx.scenes.scene2d.InputEvent event, float x, float y) protected void
goEnd
(boolean jump) protected void
goHome
(boolean jump) boolean
keyDown
(com.badlogic.gdx.scenes.scene2d.InputEvent event, int keycode) boolean
keyTyped
(com.badlogic.gdx.scenes.scene2d.InputEvent event, char character) boolean
keyUp
(com.badlogic.gdx.scenes.scene2d.InputEvent event, int keycode) protected void
scheduleKeyRepeatTask
(int keycode) protected void
setCursorPosition
(float x, float y) boolean
touchDown
(com.badlogic.gdx.scenes.scene2d.InputEvent event, float x, float y, int pointer, int button) void
touchDragged
(com.badlogic.gdx.scenes.scene2d.InputEvent event, float x, float y, int pointer) Methods inherited from class com.badlogic.gdx.scenes.scene2d.utils.ClickListener
cancel, enter, exit, getButton, getPressedButton, getPressedPointer, getTapCount, getTapSquareSize, getTouchDownX, getTouchDownY, inTapSquare, inTapSquare, invalidateTapSquare, isOver, isOver, isPressed, isVisualPressed, setButton, setTapCount, setTapCountInterval, setTapSquareSize, setVisualPressed, touchUp
Methods inherited from class com.badlogic.gdx.scenes.scene2d.InputListener
handle, mouseMoved, scrolled
-
Constructor Details
-
TextFieldClickListener
public TextFieldClickListener()
-
-
Method Details
-
clicked
public void clicked(com.badlogic.gdx.scenes.scene2d.InputEvent event, float x, float y) - Overrides:
clicked
in classcom.badlogic.gdx.scenes.scene2d.utils.ClickListener
-
touchDown
public boolean touchDown(com.badlogic.gdx.scenes.scene2d.InputEvent event, float x, float y, int pointer, int button) - Overrides:
touchDown
in classcom.badlogic.gdx.scenes.scene2d.utils.ClickListener
-
touchDragged
public void touchDragged(com.badlogic.gdx.scenes.scene2d.InputEvent event, float x, float y, int pointer) - Overrides:
touchDragged
in classcom.badlogic.gdx.scenes.scene2d.utils.ClickListener
-
setCursorPosition
protected void setCursorPosition(float x, float y) -
goHome
protected void goHome(boolean jump) -
goEnd
protected void goEnd(boolean jump) -
keyDown
public boolean keyDown(com.badlogic.gdx.scenes.scene2d.InputEvent event, int keycode) - Overrides:
keyDown
in classcom.badlogic.gdx.scenes.scene2d.InputListener
-
scheduleKeyRepeatTask
protected void scheduleKeyRepeatTask(int keycode) -
keyUp
public boolean keyUp(com.badlogic.gdx.scenes.scene2d.InputEvent event, int keycode) - Overrides:
keyUp
in classcom.badlogic.gdx.scenes.scene2d.InputListener
-
checkFocusTraversal
protected boolean checkFocusTraversal(char character) Checks if focus traversal should be triggered. The default implementation usesTextraField.focusTraversal
and the typed character, depending on the OS.- Parameters:
character
- The character that triggered a possible focus traversal.- Returns:
- true if the focus should change to the
next
input field.
-
keyTyped
public boolean keyTyped(com.badlogic.gdx.scenes.scene2d.InputEvent event, char character) - Overrides:
keyTyped
in classcom.badlogic.gdx.scenes.scene2d.InputListener
-