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 text field
-
Field Summary
Fields inherited from class com.badlogic.gdx.scenes.scene2d.utils.ClickListener
visualPressedDuration -
Constructor Summary
Constructors Constructor Description TextFieldClickListener() -
Method Summary
Modifier and Type Method Description protected booleancheckFocusTraversal(char character)Checks if focus traversal should be triggered.voidclicked(com.badlogic.gdx.scenes.scene2d.InputEvent event, float x, float y)protected voidgoEnd(boolean jump)protected voidgoHome(boolean jump)booleankeyDown(com.badlogic.gdx.scenes.scene2d.InputEvent event, int keycode)booleankeyTyped(com.badlogic.gdx.scenes.scene2d.InputEvent event, char character)booleankeyUp(com.badlogic.gdx.scenes.scene2d.InputEvent event, int keycode)protected voidscheduleKeyRepeatTask(int keycode)protected voidsetCursorPosition(float x, float y)booleantouchDown(com.badlogic.gdx.scenes.scene2d.InputEvent event, float x, float y, int pointer, int button)voidtouchDragged(com.badlogic.gdx.scenes.scene2d.InputEvent event, float x, float y, int pointer)voidtouchUp(com.badlogic.gdx.scenes.scene2d.InputEvent event, float x, float y, int pointer, int button)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, setVisualPressedMethods inherited from class com.badlogic.gdx.scenes.scene2d.InputListener
handle, mouseMoved, scrolledMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
TextFieldClickListener
public TextFieldClickListener()
-
-
Method Details
-
clicked
public void clicked(com.badlogic.gdx.scenes.scene2d.InputEvent event, float x, float y)- Overrides:
clickedin 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:
touchDownin 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:
touchDraggedin classcom.badlogic.gdx.scenes.scene2d.utils.ClickListener
-
touchUp
public void touchUp(com.badlogic.gdx.scenes.scene2d.InputEvent event, float x, float y, int pointer, int button)- Overrides:
touchUpin 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:
keyDownin 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:
keyUpin classcom.badlogic.gdx.scenes.scene2d.InputListener
-
checkFocusTraversal
protected boolean checkFocusTraversal(char character)Checks if focus traversal should be triggered. The default implementation usesTextraField.focusTraversaland 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
nextinput field.
-
keyTyped
public boolean keyTyped(com.badlogic.gdx.scenes.scene2d.InputEvent event, char character)- Overrides:
keyTypedin classcom.badlogic.gdx.scenes.scene2d.InputListener
-