Skip to content

Add Steam Controller mapping#15601

Merged
slouken merged 2 commits into
libsdl-org:mainfrom
ceski-1:sc-mapping
May 16, 2026
Merged

Add Steam Controller mapping#15601
slouken merged 2 commits into
libsdl-org:mainfrom
ceski-1:sc-mapping

Conversation

@ceski-1
Copy link
Copy Markdown
Contributor

@ceski-1 ceski-1 commented May 15, 2026

  • I confirm that I am the author of this code and release it to the SDL project under the Zlib license. This contribution does not contain code from other sources, including code generated by a Large Language Model ("AI").

Description

Here's a starting point for Steam Controller mapping to get some discussion started. This is the same as the one that was removed from #15528.

SDL             Steam Controller

misc1           QAM
right paddle1   right paddle1
left paddle1    left paddle1
right paddle2   right paddle2
left paddle2    left paddle2
touchpad        right trackpad click
misc2           left trackpad click
misc3           right stick capacitive touch
misc4           left stick capacitive touch
misc5           right gripsense
misc6           left gripsense

Existing Issue(s)

#15471

@slouken
Copy link
Copy Markdown
Collaborator

slouken commented May 15, 2026

So, thinking about prior art, how does this match up to the Hori Steam controller mapping?

@ceski-1
Copy link
Copy Markdown
Contributor Author

ceski-1 commented May 15, 2026

So, thinking about prior art, how does this match up to the Hori Steam controller mapping?

SDL             Horipad for Steam

misc1           
right paddle1   "FL" (R4 back button)
left paddle1    "FR" (L4 back button)
right paddle2   M2 (front edge below right stick)
left paddle2    M1 (front edge below dpad)
touchpad        
misc2           QAM
misc3           left stick capacitive touch
misc4           right stick capacitive touch
misc5           
misc6           

@slouken
Copy link
Copy Markdown
Collaborator

slouken commented May 15, 2026

So, thinking about prior art, how does this match up to the Hori Steam controller mapping?

SDL             Horipad for Steam

misc1           
right paddle1   "FL" (R4 back button)
left paddle1    "FR" (L4 back button)
right paddle2   M2 (front edge below right stick)
left paddle2    M1 (front edge below dpad)
touchpad        
misc2           QAM
misc3           left stick capacitive touch
misc4           right stick capacitive touch
misc5           
misc6           

At the very least, let's maintain this mapping. I'm not sure what to do with the dual touchpad clicks though.

@cgutman
Copy link
Copy Markdown
Collaborator

cgutman commented May 15, 2026

Is that right to have misc1 mapped to nothing with misc2 mapped to QAM?

Also it seems like we should probably create a SDL_GAMEPAD_TYPE for Steam Controllers, so games can understand the physical layout of those extra buttons.

@ceski-1
Copy link
Copy Markdown
Contributor Author

ceski-1 commented May 15, 2026

Yeah, QAM was already assigned to misc1 before the recent PRs.

Just to have something to think about, this may have been an ideal pattern to follow in general:

typedef enum SDL_GamepadButton
{
    //snip
    SDL_GAMEPAD_BUTTON_MISC1,           // Share, microphone, capture, QAM
    SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1,   // Upper/primary under right hand
    SDL_GAMEPAD_BUTTON_LEFT_PADDLE1,    // Upper/primary under left hand
    SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2,   // Lower/secondary under right hand or front right function button
    SDL_GAMEPAD_BUTTON_LEFT_PADDLE2,    // Lower/secondary under left hand or front left function button
    SDL_GAMEPAD_BUTTON_TOUCHPAD,        // Left/primary touch/trackpad click
    SDL_GAMEPAD_BUTTON_MISC2,           // Right/secondary touch/trackpad click
    SDL_GAMEPAD_BUTTON_MISC3,           // Left stick capacitive touch or GameCube left trigger click
    SDL_GAMEPAD_BUTTON_MISC4,           // Right stick capacitive touch or GameCube right trigger click
    SDL_GAMEPAD_BUTTON_MISC5,           // Left mini bumper (8BitDo, Flydigi, GameSir)
    SDL_GAMEPAD_BUTTON_MISC6,           // Right mini bumper (8BitDo, Flydigi, GameSir)
    SDL_GAMEPAD_BUTTON_MISC7,           // SInput reserved or C (Flydigi, GameInput, Sega 6-button)
    SDL_GAMEPAD_BUTTON_MISC8,           // SInput reserved or Z (Flydigi, GameInput, Sega 6-button)
    SDL_GAMEPAD_BUTTON_MISC9,           // SInput reserved or left gripsense
    SDL_GAMEPAD_BUTTON_MISC10,          // SInput reserved or right gripsense
    SDL_GAMEPAD_BUTTON_FINAL,           // Final button available
    SDL_GAMEPAD_BUTTON_COUNT            // 31 max due to int bit shifting in some places
} SDL_GamepadButton;

@ceski-1
Copy link
Copy Markdown
Contributor Author

ceski-1 commented May 15, 2026

At the very least, let's maintain this mapping. I'm not sure what to do with the dual touchpad clicks though.

This was merged recently: 4940345

For the Steam Controller, misc1 was already QAM, and the 4 back buttons were defined. Should the Horipad be corrected instead? My suggestions for both:

Left/right swapped to match the order used in other mappings:

SDL             Steam Controller

misc1           QAM
right paddle1   R4 back button
left paddle1    L4 back button
right paddle2   R5 back button
left paddle2    L5 back button
touchpad        left trackpad click
misc2           right trackpad click
misc3           left stick capacitive touch
misc4           right stick capacitive touch
misc5           left gripsense
misc6           right gripsense

QAM moved to misc1:

SDL             Horipad for Steam

misc1           QAM
right paddle1   R4 back button
left paddle1    L4 back button
right paddle2   M2 front button
left paddle2    M1 front button
touchpad        
misc2           
misc3           left stick capacitive touch
misc4           right stick capacitive touch
misc5           
misc6           

Like this: 7f1d039

@slouken
Copy link
Copy Markdown
Collaborator

slouken commented May 16, 2026

So I think the Hori controller having QAM on misc2 is just a bug.

The Steam Deck support should be upgraded with the same support that you added for the Steam Controller.

Then, the Steam Deck and Steam Controller should have the same mapping, with the Steam Controller using two additional buttons for grip sense.

I think what you proposed above, and have in this PR, makes a lot of sense. Thanks!

@slouken slouken marked this pull request as ready for review May 16, 2026 02:18
@slouken slouken merged commit c00d7b4 into libsdl-org:main May 16, 2026
45 of 47 checks passed
slouken pushed a commit that referenced this pull request May 16, 2026
Also fixed Hori QAM button mapping

(cherry picked from commit c00d7b4)
@slouken
Copy link
Copy Markdown
Collaborator

slouken commented May 16, 2026

Merged, thanks!

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

Successfully merging this pull request may close these issues.

3 participants