Product Metadata
Format
The product metadata byte contains a face style, and a sub-product ID that can be used to customize or separate two different gamepad models that are variants of an existing PID
Bytemask | Value |
|---|---|
0x1F | Sub-Product (0-31) |
0xE0 | Face Style (ABXY, Playstation, etc) |
Face Styles
The face style value conforms to the values used within SDL, but this is useful for
determining the button glyphs, and the glyph order.
The cardinal direction order for each face style is South, East, North, West (SEWN).
typedef enum
{
SDL_GAMEPAD_FACE_STYLE_UNKNOWN, (Xbox default)
SDL_GAMEPAD_FACE_STYLE_ABXY, (Xbox Style)
SDL_GAMEPAD_FACE_STYLE_AXBY, (GameCube Style)
SDL_GAMEPAD_FACE_STYLE_BAYX, (Nintendo Style)
SDL_GAMEPAD_FACE_STYLE_SONY, (PS4 Style)
} SDL_GamepadFaceStyle;Face Style ID | Type | Notes | South | East | West | North |
|---|---|---|---|---|---|---|
0 | HID | Standard Layout | A | B | X | Y |
1 | Xbox | A | B | X | Y | |
2 | GameCube | A | X | B | Y | |
3 | Nintendo | SNES etc. | B | A | Y | X |
4 | Sony | Shape glyphs | X | O | ◻ | △ |
Generic Devices (SDL/SteamInput)
For generic devices using USB Device ID 0x10C6 along with Vendor ID 0x2E8A, you may use an ID of 0x01 to enable all
Value | Type | Description |
|---|---|---|
0x00 | Generic Developer Mode | This will expose all axes, and all buttons to SDL for development purposes. |
0x01-0x1E | Reserved | For generic devices, these sub-product IDs are reserved for future use. |
0x1F | Generic Dynamic Mode | This will cause SDL to find and apply the closest possible mapping string and axes according to the rest of your feature response data. |
With the generic gamepad type of zero, all buttons are exposed and pre-mapped for simple implementation.
C Example (Encoding)
uint8_t metadata = 0;
// 3 bits are allocated to face style
uint8_t face_style = 2; // GameCube type
// 5 bits are allocated to generic gamepad type
uint8_t sub_product = 0x00 & 0x1F;
// Data is combined
metadata = (face_style << 5) | sub_product;
// Use metadata to set byte 5 of the features response data