Games Dualshock 4 (PS4) Controller KeyCode Values

wonder

Expert
Licensed User
Longtime User
ds4.png


B4X:
'Playstation 4 Controller: Dualshock 4 (Sony Interactive Entertainment Wireless Controller)
'------------------------------------------------------------------------------------------
    Dim BUTTON_L1                As Int = 100     'Key code constant: L1 trigger.
    Dim BUTTON_L2                As Int = 102     'Key code constant: L2 trigger.
    Dim BUTTON_L3                As Int = 108     'Key code constant: L3 press.
    Dim BUTTON_R1                As Int = 101     'Key code constant: R1 trigger.
    Dim BUTTON_R2                As Int = 103     'Key code constant: R2 trigger.
    Dim BUTTON_R3                As Int = 108     'Key code constant: R3 press.
    Dim BUTTON_SELECT            As Int = 104     'Key code constant: SHARE when used for Select function.
    Dim BUTTON_SHARE             As Int = 104     'Key code constant: SHARE button.
    Dim BUTTON_START             As Int = 105     'Key code constant: OPTIONS when used for the Start functions.
    Dim BUTTON_OPTIONS           As Int = 105     'Key code constant: OPTIONS button.
    Dim BUTTON_TOUCHPAD          As Int = 106     'Key code constant: TOUCHPAD press.     
    Dim BUTTON_CROSS             As Int =  97     'Key code constant: CROSS button.
    Dim BUTTON_CIRCLE            As Int =  98     'Key code constant: CIRCLE button.
    Dim BUTTON_SQUARE            As Int =  96     'Key code constant: SQUARE button.
    Dim BUTTON_TRIANGLE          As Int =  99     'Key code constant: TRIANGLE button.
'------------------------------------------------------------------------------------------

'Notes:
'- The D-Pad is handled by AXIS_HAT_X (-1, 0, 1) and AXIS_HAT_Y (-1, 0, 1).
'- The Left Analog is handled by AXIS_X and AXIS_Y.
'- The Right Analog is handled by AXIS_Z and AXIS_RZ.

More info: https://developer.android.com/training/game-controllers/controller-input.html

Have a nice day! :)
 
Top