public class PS4UiInput extends PS4GamePadAdapter implements GamePadUiInput<PS4Button>
PS4GamePad
implementation of GamePadUiInput
Constructor and Description |
---|
PS4UiInput(UiContainer uiContainer) |
Modifier and Type | Method and Description |
---|---|
boolean |
buttonDown(PS4GamePad controller,
PS4Button button) |
boolean |
buttonUp(PS4GamePad controller,
PS4Button button) |
void |
disable()
Disables this gamepad input for the
UiContainer |
void |
dispose()
Cleans up and de-registers this instance from the associated
UiContainer |
void |
enable()
Enables this gamepad input for the
UiContainer |
boolean |
equals(java.lang.Object obj) |
PS4Button |
getActionButton()
Returns the button used to trigger
Actionable instances |
java.lang.String |
getId()
Returns the unique id of this
GamePadUiInput |
int |
hashCode() |
boolean |
isEnabled()
Returns if the gamepad input is enabled for the
UiContainer |
boolean |
isNavigateWithDPad()
Returns if
UiNavigation events should be triggered by the D-PAD |
boolean |
leftStickXMoved(PS4GamePad controller,
float value) |
boolean |
leftStickYMoved(PS4GamePad controller,
float value) |
void |
setActionButton(PS4Button actionButton)
Sets the button used for triggering
Actionable instances |
void |
setNavigateWithDPad(boolean navigateWithDPad)
Sets if
UiNavigation events should be triggered by the D-PAD |
void |
setStickRepeatTimer(float stickRepeatTimer)
Sets the amount of time in seconds before the left stick is considered repeating a navigation direction
|
void |
setStickThreshold(float stickThreshold)
Sets the threshold for stick values before the input is considered as a navigation direction press
|
void |
update(float delta)
Updates the input for repeating presses
|
connected, disconnected, l2Moved, r2Moved, rightStickXMoved, rightStickYMoved
public PS4UiInput(UiContainer uiContainer)
public void update(float delta)
GamePadUiInput
update
in interface GamePadUiInput<PS4Button>
delta
- The time since the last frame (in seconds)public boolean leftStickXMoved(PS4GamePad controller, float value)
leftStickXMoved
in interface PS4GamePadListener
leftStickXMoved
in class PS4GamePadAdapter
public boolean leftStickYMoved(PS4GamePad controller, float value)
leftStickYMoved
in interface PS4GamePadListener
leftStickYMoved
in class PS4GamePadAdapter
public boolean buttonDown(PS4GamePad controller, PS4Button button)
buttonDown
in interface PS4GamePadListener
buttonDown
in class PS4GamePadAdapter
public boolean buttonUp(PS4GamePad controller, PS4Button button)
buttonUp
in interface PS4GamePadListener
buttonUp
in class PS4GamePadAdapter
public boolean isEnabled()
GamePadUiInput
UiContainer
isEnabled
in interface GamePadUiInput<PS4Button>
public void enable()
GamePadUiInput
UiContainer
enable
in interface GamePadUiInput<PS4Button>
public void disable()
GamePadUiInput
UiContainer
disable
in interface GamePadUiInput<PS4Button>
public void setStickRepeatTimer(float stickRepeatTimer)
stickRepeatTimer
- Default value is 0.25 secondspublic void setStickThreshold(float stickThreshold)
stickThreshold
- Default value is 0.25public boolean isNavigateWithDPad()
UiNavigation
events should be triggered by the D-PADpublic void setNavigateWithDPad(boolean navigateWithDPad)
UiNavigation
events should be triggered by the D-PADnavigateWithDPad
- True if events should be triggeredpublic PS4Button getActionButton()
GamePadUiInput
Actionable
instancesgetActionButton
in interface GamePadUiInput<PS4Button>
public void setActionButton(PS4Button actionButton)
GamePadUiInput
Actionable
instancessetActionButton
in interface GamePadUiInput<PS4Button>
public void dispose()
GamePadUiInput
UiContainer
dispose
in interface GamePadUiInput<PS4Button>
public java.lang.String getId()
GamePadUiInput
GamePadUiInput
getId
in interface GamePadUiInput<PS4Button>
String
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object