Relabel back paddles as left or right
The sequence order of the four paddles is not obvious, with SDL and Xbox controllers swapping the order of P2 and P3 relative to each other. If we group them into left and right, then it becomes more obvious. Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
committed by
Sam Lantinga
parent
be884f0c95
commit
efe15588d5
@@ -1105,29 +1105,31 @@ const char *SDL_GetGamepadStringForAxis(SDL_GamepadAxis axis)
|
||||
}
|
||||
|
||||
static const char *map_StringForGamepadButton[] = {
|
||||
"a",
|
||||
"b",
|
||||
"x",
|
||||
"y",
|
||||
"back",
|
||||
"guide",
|
||||
"start",
|
||||
"leftstick",
|
||||
"rightstick",
|
||||
"leftshoulder",
|
||||
"rightshoulder",
|
||||
"dpup",
|
||||
"dpdown",
|
||||
"dpleft",
|
||||
"dpright",
|
||||
"misc1",
|
||||
"paddle1",
|
||||
"paddle2",
|
||||
"paddle3",
|
||||
"paddle4",
|
||||
"touchpad"
|
||||
"a", NULL,
|
||||
"b", NULL,
|
||||
"x", NULL,
|
||||
"y", NULL,
|
||||
"back", NULL,
|
||||
"guide", NULL,
|
||||
"start", NULL,
|
||||
"leftstick", NULL,
|
||||
"rightstick", NULL,
|
||||
"leftshoulder", NULL,
|
||||
"rightshoulder", NULL,
|
||||
"dpup", NULL,
|
||||
"dpdown", NULL,
|
||||
"dpleft", NULL,
|
||||
"dpright", NULL,
|
||||
"misc1", NULL,
|
||||
/* Keep using paddle1-4 when we generate mapping strings so that they
|
||||
* can be reused with SDL2, but accept rightpaddle1 etc. as input */
|
||||
"paddle1", "rightpaddle1",
|
||||
"paddle2", "leftpaddle1",
|
||||
"paddle3", "rightpaddle2",
|
||||
"paddle4", "leftpaddle2",
|
||||
"touchpad", NULL
|
||||
};
|
||||
SDL_COMPILE_TIME_ASSERT(map_StringForGamepadButton, SDL_arraysize(map_StringForGamepadButton) == SDL_GAMEPAD_BUTTON_MAX);
|
||||
SDL_COMPILE_TIME_ASSERT(map_StringForGamepadButton, SDL_arraysize(map_StringForGamepadButton) == 2 * SDL_GAMEPAD_BUTTON_MAX);
|
||||
|
||||
/*
|
||||
* convert a string to its enum equivalent
|
||||
@@ -1141,8 +1143,8 @@ SDL_GamepadButton SDL_GetGamepadButtonFromString(const char *str)
|
||||
}
|
||||
|
||||
for (i = 0; i < SDL_arraysize(map_StringForGamepadButton); ++i) {
|
||||
if (SDL_strcasecmp(str, map_StringForGamepadButton[i]) == 0) {
|
||||
return (SDL_GamepadButton)i;
|
||||
if (map_StringForGamepadButton[i] && SDL_strcasecmp(str, map_StringForGamepadButton[i]) == 0) {
|
||||
return (SDL_GamepadButton) (i / 2);
|
||||
}
|
||||
}
|
||||
return SDL_GAMEPAD_BUTTON_INVALID;
|
||||
@@ -1154,7 +1156,7 @@ SDL_GamepadButton SDL_GetGamepadButtonFromString(const char *str)
|
||||
const char *SDL_GetGamepadStringForButton(SDL_GamepadButton button)
|
||||
{
|
||||
if (button > SDL_GAMEPAD_BUTTON_INVALID && button < SDL_GAMEPAD_BUTTON_MAX) {
|
||||
return map_StringForGamepadButton[button];
|
||||
return map_StringForGamepadButton[button * 2];
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@@ -1660,10 +1662,12 @@ static GamepadMapping_t *SDL_PrivateGenerateAutomaticGamepadMapping(const char *
|
||||
SDL_PrivateAppendToMappingString(mapping, sizeof(mapping), "dpleft", &raw_map->dpleft);
|
||||
SDL_PrivateAppendToMappingString(mapping, sizeof(mapping), "dpright", &raw_map->dpright);
|
||||
SDL_PrivateAppendToMappingString(mapping, sizeof(mapping), "misc1", &raw_map->misc1);
|
||||
SDL_PrivateAppendToMappingString(mapping, sizeof(mapping), "paddle1", &raw_map->paddle1);
|
||||
SDL_PrivateAppendToMappingString(mapping, sizeof(mapping), "paddle2", &raw_map->paddle2);
|
||||
SDL_PrivateAppendToMappingString(mapping, sizeof(mapping), "paddle3", &raw_map->paddle3);
|
||||
SDL_PrivateAppendToMappingString(mapping, sizeof(mapping), "paddle4", &raw_map->paddle4);
|
||||
/* Keep using paddle1-4 in the generated mapping so that it can be
|
||||
* reused with SDL2 */
|
||||
SDL_PrivateAppendToMappingString(mapping, sizeof(mapping), "paddle1", &raw_map->right_paddle1);
|
||||
SDL_PrivateAppendToMappingString(mapping, sizeof(mapping), "paddle2", &raw_map->left_paddle1);
|
||||
SDL_PrivateAppendToMappingString(mapping, sizeof(mapping), "paddle3", &raw_map->right_paddle2);
|
||||
SDL_PrivateAppendToMappingString(mapping, sizeof(mapping), "paddle4", &raw_map->left_paddle2);
|
||||
SDL_PrivateAppendToMappingString(mapping, sizeof(mapping), "leftx", &raw_map->leftx);
|
||||
SDL_PrivateAppendToMappingString(mapping, sizeof(mapping), "lefty", &raw_map->lefty);
|
||||
SDL_PrivateAppendToMappingString(mapping, sizeof(mapping), "rightx", &raw_map->rightx);
|
||||
|
||||
@@ -196,10 +196,10 @@ typedef struct SDL_GamepadMapping
|
||||
SDL_InputMapping dpleft;
|
||||
SDL_InputMapping dpright;
|
||||
SDL_InputMapping misc1;
|
||||
SDL_InputMapping paddle1;
|
||||
SDL_InputMapping paddle2;
|
||||
SDL_InputMapping paddle3;
|
||||
SDL_InputMapping paddle4;
|
||||
SDL_InputMapping right_paddle1;
|
||||
SDL_InputMapping left_paddle1;
|
||||
SDL_InputMapping right_paddle2;
|
||||
SDL_InputMapping left_paddle2;
|
||||
SDL_InputMapping leftx;
|
||||
SDL_InputMapping lefty;
|
||||
SDL_InputMapping rightx;
|
||||
|
||||
@@ -349,22 +349,24 @@ static BOOL IOS_AddMFIJoystickDevice(SDL_JoystickDeviceItem *device, GCControlle
|
||||
}
|
||||
if (controller.physicalInputProfile.buttons[GCInputXboxPaddleOne] != nil) {
|
||||
device->has_xbox_paddles = SDL_TRUE;
|
||||
device->button_mask |= (1 << SDL_GAMEPAD_BUTTON_PADDLE1);
|
||||
device->button_mask |= (1 << SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1);
|
||||
++nbuttons;
|
||||
}
|
||||
if (controller.physicalInputProfile.buttons[GCInputXboxPaddleTwo] != nil) {
|
||||
/* TODO: Is this right? SDL_gamepad.h says P2 is the lower right */
|
||||
device->has_xbox_paddles = SDL_TRUE;
|
||||
device->button_mask |= (1 << SDL_GAMEPAD_BUTTON_PADDLE2);
|
||||
device->button_mask |= (1 << SDL_GAMEPAD_BUTTON_LEFT_PADDLE1);
|
||||
++nbuttons;
|
||||
}
|
||||
if (controller.physicalInputProfile.buttons[GCInputXboxPaddleThree] != nil) {
|
||||
/* TODO: Is this right? SDL_gamepad.h says P3 is the upper left */
|
||||
device->has_xbox_paddles = SDL_TRUE;
|
||||
device->button_mask |= (1 << SDL_GAMEPAD_BUTTON_PADDLE3);
|
||||
device->button_mask |= (1 << SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2);
|
||||
++nbuttons;
|
||||
}
|
||||
if (controller.physicalInputProfile.buttons[GCInputXboxPaddleFour] != nil) {
|
||||
device->has_xbox_paddles = SDL_TRUE;
|
||||
device->button_mask |= (1 << SDL_GAMEPAD_BUTTON_PADDLE4);
|
||||
device->button_mask |= (1 << SDL_GAMEPAD_BUTTON_LEFT_PADDLE2);
|
||||
++nbuttons;
|
||||
}
|
||||
if (controller.physicalInputProfile.buttons[GCInputXboxShareButton] != nil) {
|
||||
@@ -1055,16 +1057,16 @@ static void IOS_MFIJoystickUpdate(SDL_Joystick *joystick)
|
||||
}
|
||||
|
||||
if (joystick->hwdata->has_xbox_paddles) {
|
||||
if (joystick->hwdata->button_mask & (1 << SDL_GAMEPAD_BUTTON_PADDLE1)) {
|
||||
if (joystick->hwdata->button_mask & (1 << SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1)) {
|
||||
buttons[button_count++] = controller.physicalInputProfile.buttons[GCInputXboxPaddleOne].isPressed;
|
||||
}
|
||||
if (joystick->hwdata->button_mask & (1 << SDL_GAMEPAD_BUTTON_PADDLE2)) {
|
||||
if (joystick->hwdata->button_mask & (1 << SDL_GAMEPAD_BUTTON_LEFT_PADDLE1)) {
|
||||
buttons[button_count++] = controller.physicalInputProfile.buttons[GCInputXboxPaddleTwo].isPressed;
|
||||
}
|
||||
if (joystick->hwdata->button_mask & (1 << SDL_GAMEPAD_BUTTON_PADDLE3)) {
|
||||
if (joystick->hwdata->button_mask & (1 << SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2)) {
|
||||
buttons[button_count++] = controller.physicalInputProfile.buttons[GCInputXboxPaddleThree].isPressed;
|
||||
}
|
||||
if (joystick->hwdata->button_mask & (1 << SDL_GAMEPAD_BUTTON_PADDLE4)) {
|
||||
if (joystick->hwdata->button_mask & (1 << SDL_GAMEPAD_BUTTON_LEFT_PADDLE2)) {
|
||||
buttons[button_count++] = controller.physicalInputProfile.buttons[GCInputXboxPaddleFour].isPressed;
|
||||
}
|
||||
|
||||
@@ -1826,16 +1828,18 @@ const char *IOS_GetAppleSFSymbolsNameForButton(SDL_Gamepad *gamepad, SDL_Gamepad
|
||||
case SDL_GAMEPAD_BUTTON_MISC1:
|
||||
GetAppleSFSymbolsNameForElement(elements[GCInputDualShockTouchpadButton], elementName);
|
||||
break;
|
||||
case SDL_GAMEPAD_BUTTON_PADDLE1:
|
||||
case SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1:
|
||||
GetAppleSFSymbolsNameForElement(elements[GCInputXboxPaddleOne], elementName);
|
||||
break;
|
||||
case SDL_GAMEPAD_BUTTON_PADDLE2:
|
||||
case SDL_GAMEPAD_BUTTON_LEFT_PADDLE1:
|
||||
/* TODO: Is this right? SDL_gamepad.h says P2 is the lower right */
|
||||
GetAppleSFSymbolsNameForElement(elements[GCInputXboxPaddleTwo], elementName);
|
||||
break;
|
||||
case SDL_GAMEPAD_BUTTON_PADDLE3:
|
||||
case SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2:
|
||||
/* TODO: Is this right? SDL_gamepad.h says P3 is the upper left */
|
||||
GetAppleSFSymbolsNameForElement(elements[GCInputXboxPaddleThree], elementName);
|
||||
break;
|
||||
case SDL_GAMEPAD_BUTTON_PADDLE4:
|
||||
case SDL_GAMEPAD_BUTTON_LEFT_PADDLE2:
|
||||
GetAppleSFSymbolsNameForElement(elements[GCInputXboxPaddleFour], elementName);
|
||||
break;
|
||||
case SDL_GAMEPAD_BUTTON_TOUCHPAD:
|
||||
|
||||
@@ -1888,8 +1888,8 @@ static void HandleCombinedControllerStateL(Uint64 timestamp, SDL_Joystick *joyst
|
||||
SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_DPAD_UP, (data & 0x02) ? SDL_PRESSED : SDL_RELEASED);
|
||||
SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_DPAD_RIGHT, (data & 0x04) ? SDL_PRESSED : SDL_RELEASED);
|
||||
SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_DPAD_LEFT, (data & 0x08) ? SDL_PRESSED : SDL_RELEASED);
|
||||
SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_PADDLE4, (data & 0x10) ? SDL_PRESSED : SDL_RELEASED);
|
||||
SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_PADDLE2, (data & 0x20) ? SDL_PRESSED : SDL_RELEASED);
|
||||
SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_LEFT_PADDLE2, (data & 0x10) ? SDL_PRESSED : SDL_RELEASED);
|
||||
SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_LEFT_PADDLE1, (data & 0x20) ? SDL_PRESSED : SDL_RELEASED);
|
||||
SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_LEFT_SHOULDER, (data & 0x40) ? SDL_PRESSED : SDL_RELEASED);
|
||||
axis = (data & 0x80) ? 32767 : -32768;
|
||||
SDL_SendJoystickAxis(timestamp, joystick, SDL_GAMEPAD_AXIS_LEFT_TRIGGER, axis);
|
||||
@@ -1923,8 +1923,8 @@ static void HandleMiniControllerStateL(Uint64 timestamp, SDL_Joystick *joystick,
|
||||
SDL_SendJoystickButton(timestamp, joystick, RemapButton(ctx, SDL_GAMEPAD_BUTTON_B), (data & 0x08) ? SDL_PRESSED : SDL_RELEASED);
|
||||
SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER, (data & 0x10) ? SDL_PRESSED : SDL_RELEASED);
|
||||
SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_LEFT_SHOULDER, (data & 0x20) ? SDL_PRESSED : SDL_RELEASED);
|
||||
SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_PADDLE2, (data & 0x40) ? SDL_PRESSED : SDL_RELEASED);
|
||||
SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_PADDLE4, (data & 0x80) ? SDL_PRESSED : SDL_RELEASED);
|
||||
SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_LEFT_PADDLE1, (data & 0x40) ? SDL_PRESSED : SDL_RELEASED);
|
||||
SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_LEFT_PADDLE2, (data & 0x80) ? SDL_PRESSED : SDL_RELEASED);
|
||||
}
|
||||
|
||||
axis = packet->controllerState.rgucJoystickLeft[0] | ((packet->controllerState.rgucJoystickLeft[1] & 0xF) << 8);
|
||||
@@ -1946,8 +1946,8 @@ static void HandleCombinedControllerStateR(Uint64 timestamp, SDL_Joystick *joyst
|
||||
SDL_SendJoystickButton(timestamp, joystick, RemapButton(ctx, SDL_GAMEPAD_BUTTON_B), (data & 0x04) ? SDL_PRESSED : SDL_RELEASED);
|
||||
SDL_SendJoystickButton(timestamp, joystick, RemapButton(ctx, SDL_GAMEPAD_BUTTON_X), (data & 0x02) ? SDL_PRESSED : SDL_RELEASED);
|
||||
SDL_SendJoystickButton(timestamp, joystick, RemapButton(ctx, SDL_GAMEPAD_BUTTON_Y), (data & 0x01) ? SDL_PRESSED : SDL_RELEASED);
|
||||
SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_PADDLE1, (data & 0x10) ? SDL_PRESSED : SDL_RELEASED);
|
||||
SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_PADDLE3, (data & 0x20) ? SDL_PRESSED : SDL_RELEASED);
|
||||
SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1, (data & 0x10) ? SDL_PRESSED : SDL_RELEASED);
|
||||
SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2, (data & 0x20) ? SDL_PRESSED : SDL_RELEASED);
|
||||
SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER, (data & 0x40) ? SDL_PRESSED : SDL_RELEASED);
|
||||
axis = (data & 0x80) ? 32767 : -32768;
|
||||
SDL_SendJoystickAxis(timestamp, joystick, SDL_GAMEPAD_AXIS_RIGHT_TRIGGER, axis);
|
||||
@@ -1981,8 +1981,8 @@ static void HandleMiniControllerStateR(Uint64 timestamp, SDL_Joystick *joystick,
|
||||
SDL_SendJoystickButton(timestamp, joystick, RemapButton(ctx, SDL_GAMEPAD_BUTTON_X), (data & 0x01) ? SDL_PRESSED : SDL_RELEASED);
|
||||
SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER, (data & 0x10) ? SDL_PRESSED : SDL_RELEASED);
|
||||
SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_LEFT_SHOULDER, (data & 0x20) ? SDL_PRESSED : SDL_RELEASED);
|
||||
SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_PADDLE1, (data & 0x40) ? SDL_PRESSED : SDL_RELEASED);
|
||||
SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_PADDLE3, (data & 0x80) ? SDL_PRESSED : SDL_RELEASED);
|
||||
SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1, (data & 0x40) ? SDL_PRESSED : SDL_RELEASED);
|
||||
SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2, (data & 0x80) ? SDL_PRESSED : SDL_RELEASED);
|
||||
}
|
||||
|
||||
if (packet->controllerState.rgucButtons[1] != ctx->m_lastFullState.controllerState.rgucButtons[1]) {
|
||||
|
||||
@@ -2517,19 +2517,19 @@ static SDL_bool LINUX_JoystickGetGamepadMapping(int device_index, SDL_GamepadMap
|
||||
joystick->hwdata->has_key[BTN_TRIGGER_HAPPY6] &&
|
||||
joystick->hwdata->has_key[BTN_TRIGGER_HAPPY7] &&
|
||||
joystick->hwdata->has_key[BTN_TRIGGER_HAPPY8]) {
|
||||
out->paddle1.kind = EMappingKind_Button;
|
||||
out->paddle1.target = joystick->hwdata->key_map[BTN_TRIGGER_HAPPY5];
|
||||
out->paddle2.kind = EMappingKind_Button;
|
||||
out->paddle2.target = joystick->hwdata->key_map[BTN_TRIGGER_HAPPY7];
|
||||
out->paddle3.kind = EMappingKind_Button;
|
||||
out->paddle3.target = joystick->hwdata->key_map[BTN_TRIGGER_HAPPY6];
|
||||
out->paddle4.kind = EMappingKind_Button;
|
||||
out->paddle4.target = joystick->hwdata->key_map[BTN_TRIGGER_HAPPY8];
|
||||
out->right_paddle1.kind = EMappingKind_Button;
|
||||
out->right_paddle1.target = joystick->hwdata->key_map[BTN_TRIGGER_HAPPY5];
|
||||
out->left_paddle1.kind = EMappingKind_Button;
|
||||
out->left_paddle1.target = joystick->hwdata->key_map[BTN_TRIGGER_HAPPY7];
|
||||
out->right_paddle2.kind = EMappingKind_Button;
|
||||
out->right_paddle2.target = joystick->hwdata->key_map[BTN_TRIGGER_HAPPY6];
|
||||
out->left_paddle2.kind = EMappingKind_Button;
|
||||
out->left_paddle2.target = joystick->hwdata->key_map[BTN_TRIGGER_HAPPY8];
|
||||
#ifdef DEBUG_GAMEPAD_MAPPING
|
||||
SDL_Log("Mapped PADDLE1 to button %d (BTN_TRIGGER_HAPPY5)", out->paddle1.target);
|
||||
SDL_Log("Mapped PADDLE2 to button %d (BTN_TRIGGER_HAPPY7)", out->paddle2.target);
|
||||
SDL_Log("Mapped PADDLE3 to button %d (BTN_TRIGGER_HAPPY6)", out->paddle3.target);
|
||||
SDL_Log("Mapped PADDLE4 to button %d (BTN_TRIGGER_HAPPY8)", out->paddle4.target);
|
||||
SDL_Log("Mapped RIGHT_PADDLE1 to button %d (BTN_TRIGGER_HAPPY5)", out->right_paddle1.target);
|
||||
SDL_Log("Mapped LEFT_PADDLE1 to button %d (BTN_TRIGGER_HAPPY7)", out->left_paddle1.target);
|
||||
SDL_Log("Mapped RIGHT_PADDLE2 to button %d (BTN_TRIGGER_HAPPY6)", out->right_paddle2.target);
|
||||
SDL_Log("Mapped LEFT_PADDLE2 to button %d (BTN_TRIGGER_HAPPY8)", out->left_paddle2.target);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -198,10 +198,10 @@ static SDL_bool N3DS_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapp
|
||||
.dpleft = { EMappingKind_Button, 5 },
|
||||
.dpright = { EMappingKind_Button, 4 },
|
||||
.misc1 = { EMappingKind_None, 255 },
|
||||
.paddle1 = { EMappingKind_None, 255 },
|
||||
.paddle2 = { EMappingKind_None, 255 },
|
||||
.paddle3 = { EMappingKind_None, 255 },
|
||||
.paddle4 = { EMappingKind_None, 255 },
|
||||
.right_paddle1 = { EMappingKind_None, 255 },
|
||||
.left_paddle1 = { EMappingKind_None, 255 },
|
||||
.right_paddle2 = { EMappingKind_None, 255 },
|
||||
.left_paddle2 = { EMappingKind_None, 255 },
|
||||
.leftx = { EMappingKind_Axis, 0 },
|
||||
.lefty = { EMappingKind_Axis, 1 },
|
||||
.rightx = { EMappingKind_Axis, 2 },
|
||||
|
||||
@@ -669,24 +669,24 @@ static SDL_bool VIRTUAL_JoystickGetGamepadMapping(int device_index, SDL_GamepadM
|
||||
out->misc1.target = current_button++;
|
||||
}
|
||||
|
||||
if (current_button < hwdata->desc.nbuttons && (hwdata->desc.button_mask & (1 << SDL_GAMEPAD_BUTTON_PADDLE1))) {
|
||||
out->paddle1.kind = EMappingKind_Button;
|
||||
out->paddle1.target = current_button++;
|
||||
if (current_button < hwdata->desc.nbuttons && (hwdata->desc.button_mask & (1 << SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1))) {
|
||||
out->right_paddle1.kind = EMappingKind_Button;
|
||||
out->right_paddle1.target = current_button++;
|
||||
}
|
||||
|
||||
if (current_button < hwdata->desc.nbuttons && (hwdata->desc.button_mask & (1 << SDL_GAMEPAD_BUTTON_PADDLE2))) {
|
||||
out->paddle2.kind = EMappingKind_Button;
|
||||
out->paddle2.target = current_button++;
|
||||
if (current_button < hwdata->desc.nbuttons && (hwdata->desc.button_mask & (1 << SDL_GAMEPAD_BUTTON_LEFT_PADDLE1))) {
|
||||
out->left_paddle1.kind = EMappingKind_Button;
|
||||
out->left_paddle1.target = current_button++;
|
||||
}
|
||||
|
||||
if (current_button < hwdata->desc.nbuttons && (hwdata->desc.button_mask & (1 << SDL_GAMEPAD_BUTTON_PADDLE3))) {
|
||||
out->paddle3.kind = EMappingKind_Button;
|
||||
out->paddle3.target = current_button++;
|
||||
if (current_button < hwdata->desc.nbuttons && (hwdata->desc.button_mask & (1 << SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2))) {
|
||||
out->right_paddle2.kind = EMappingKind_Button;
|
||||
out->right_paddle2.target = current_button++;
|
||||
}
|
||||
|
||||
if (current_button < hwdata->desc.nbuttons && (hwdata->desc.button_mask & (1 << SDL_GAMEPAD_BUTTON_PADDLE4))) {
|
||||
out->paddle4.kind = EMappingKind_Button;
|
||||
out->paddle4.target = current_button++;
|
||||
if (current_button < hwdata->desc.nbuttons && (hwdata->desc.button_mask & (1 << SDL_GAMEPAD_BUTTON_LEFT_PADDLE2))) {
|
||||
out->left_paddle2.kind = EMappingKind_Button;
|
||||
out->left_paddle2.target = current_button++;
|
||||
}
|
||||
|
||||
if (current_axis < hwdata->desc.naxes && (hwdata->desc.axis_mask & (1 << SDL_GAMEPAD_AXIS_LEFTX))) {
|
||||
|
||||
Reference in New Issue
Block a user