Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support DualShock 3 analog buttons #5339

Closed
Xottab-DUTY opened this issue Feb 9, 2022 · 2 comments
Closed

Support DualShock 3 analog buttons #5339

Xottab-DUTY opened this issue Feb 9, 2022 · 2 comments

Comments

@Xottab-DUTY
Copy link

/**
 *  \brief Game controller button event structure (event.cbutton.*)
 */
typedef struct SDL_ControllerButtonEvent
{
    Uint32 type;        /**< ::SDL_CONTROLLERBUTTONDOWN or ::SDL_CONTROLLERBUTTONUP */
    Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
    SDL_JoystickID which; /**< The joystick instance id */
    Uint8 button;       /**< The controller button (SDL_GameControllerButton) */
    Uint8 state;        /**< ::SDL_PRESSED or ::SDL_RELEASED */
    Uint8 padding1;
    Uint8 padding2;
} SDL_ControllerButtonEvent;

cbutton.state currently supports only two values: SDL_PRESSED and SDL_RELEASED. It would be nice to see state containing values from 0 to 255, indicating the pressure. (after enabling a newly introduced hint, to not break backwards compatibility)
Or we can reuse padding1 and padding2 as Uint16 or whatever for new pressure member of SDL_ControllerButtonEvent structure.

This can be used when DualShock 3 is connected, because it's buttons are analog and it sends pressure data to the system.

I would like to look at this myself and try to implement it. But I'm creating this issue beforehand to get general feedback if SDL wants this feature at all and maybe some useful hints on implementation.

@icculus
Copy link
Collaborator

icculus commented Feb 14, 2022

I would hesitate to change this.

Sony dropped the analog face buttons for the PS4 (PS2 and PS3 had them, and a handful of games used them: the Metal Gear Solid series would let you slowly lift a finger to lower a weapon without firing it, some racing game would accelerate based on pressure, etc), but I suspect most players never knew the buttons were analog at all, new controllers don't have the feature, and no other vendor ever supported it.

@Xottab-DUTY
Copy link
Author

Just in case someone found this issue and doesn't know – there was another attempt to request this feature in #5148 and it was successful!
Requested feature was added. See #5148 for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants