Class TextField.TextFieldClickListener
- java.lang.Object
-
- com.badlogic.gdx.scenes.scene2d.InputListener
-
- com.badlogic.gdx.scenes.scene2d.utils.ClickListener
-
- com.badlogic.gdx.scenes.scene2d.ui.TextField.TextFieldClickListener
-
- All Implemented Interfaces:
EventListener
- Direct Known Subclasses:
TextArea.TextAreaListener
- Enclosing class:
- TextField
public class TextField.TextFieldClickListener extends 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancheckFocusTraversal(char character)Checks if focus traversal should be triggered.voidclicked(InputEvent event, float x, float y)protected voidgoEnd(boolean jump)protected voidgoHome(boolean jump)booleankeyDown(InputEvent event, int keycode)Called when a key goes down.booleankeyTyped(InputEvent event, char character)Called when a key is typed.booleankeyUp(InputEvent event, int keycode)Called when a key goes up.protected voidscheduleKeyRepeatTask(int keycode)protected voidsetCursorPosition(float x, float y)booleantouchDown(InputEvent event, float x, float y, int pointer, int button)Called when a mouse button or a finger touch goes down on the actor.voidtouchDragged(InputEvent event, float x, float y, int pointer)Called when a mouse button or a finger touch is moved anywhere, but only if touchDown previously returned true for the mouse button or touch.voidtouchUp(InputEvent event, float x, float y, int pointer, int button)Called when a mouse button or a finger touch goes up anywhere, but only if touchDown previously returned true for the mouse button or touch.-
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
-
Methods inherited from class com.badlogic.gdx.scenes.scene2d.InputListener
handle, mouseMoved, scrolled
-
-
-
-
Method Detail
-
clicked
public void clicked(InputEvent event, float x, float y)
- Overrides:
clickedin classClickListener
-
touchDown
public boolean touchDown(InputEvent event, float x, float y, int pointer, int button)
Description copied from class:InputListenerCalled when a mouse button or a finger touch goes down on the actor. If true is returned, this listener will havetouch focus, so it will receive all touchDragged and touchUp events, even those not over this actor, until touchUp is received. Also when true is returned, the event ishandled.- Overrides:
touchDownin classClickListener- See Also:
InputEvent
-
touchDragged
public void touchDragged(InputEvent event, float x, float y, int pointer)
Description copied from class:InputListenerCalled when a mouse button or a finger touch is moved anywhere, but only if touchDown previously returned true for the mouse button or touch. The touchDragged event is alwayshandled.- Overrides:
touchDraggedin classClickListener- See Also:
InputEvent
-
touchUp
public void touchUp(InputEvent event, float x, float y, int pointer, int button)
Description copied from class:InputListenerCalled when a mouse button or a finger touch goes up anywhere, but only if touchDown previously returned true for the mouse button or touch. The touchUp event is alwayshandled.- Overrides:
touchUpin classClickListener- See Also:
InputEvent
-
setCursorPosition
protected void setCursorPosition(float x, float y)
-
goHome
protected void goHome(boolean jump)
-
goEnd
protected void goEnd(boolean jump)
-
keyDown
public boolean keyDown(InputEvent event, int keycode)
Description copied from class:InputListenerCalled when a key goes down. When true is returned, the event ishandled.- Overrides:
keyDownin classInputListener
-
scheduleKeyRepeatTask
protected void scheduleKeyRepeatTask(int keycode)
-
keyUp
public boolean keyUp(InputEvent event, int keycode)
Description copied from class:InputListenerCalled when a key goes up. When true is returned, the event ishandled.- Overrides:
keyUpin classInputListener
-
checkFocusTraversal
protected boolean checkFocusTraversal(char character)
Checks if focus traversal should be triggered. The default implementation usesTextField.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(InputEvent event, char character)
Description copied from class:InputListenerCalled when a key is typed. When true is returned, the event ishandled.- Overrides:
keyTypedin classInputListenercharacter- May be 0 for key typed events that don't map to a character (ctrl, shift, etc).
-
-