mirror of
https://github.com/libretro/RetroArch
synced 2025-03-24 22:43:41 +00:00
(Android) Add preliminary Ouya controller support
This commit is contained in:
parent
559b5d39fc
commit
1458678dbc
@ -1088,6 +1088,27 @@ static void android_input_set_keybinds(void *data, unsigned device,
|
||||
keycode_lut[AKEYCODE_BUTTON_L1] |= ((RETRO_DEVICE_ID_JOYPAD_L+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_R1] |= ((RETRO_DEVICE_ID_JOYPAD_R+1) << shift);
|
||||
break;
|
||||
case DEVICE_OUYA:
|
||||
g_settings.input.device[port] = device;
|
||||
strlcpy(g_settings.input.device_names[port], "OUYA",
|
||||
sizeof(g_settings.input.device_names[port]));
|
||||
|
||||
keycode_lut[AKEYCODE_DPAD_UP] |= ((RETRO_DEVICE_ID_JOYPAD_UP+1) << shift);
|
||||
keycode_lut[AKEYCODE_DPAD_DOWN] |= ((RETRO_DEVICE_ID_JOYPAD_DOWN+1) << shift);
|
||||
keycode_lut[AKEYCODE_DPAD_LEFT] |= ((RETRO_DEVICE_ID_JOYPAD_LEFT+1) << shift);
|
||||
keycode_lut[AKEYCODE_DPAD_RIGHT] |= ((RETRO_DEVICE_ID_JOYPAD_RIGHT+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_X] |= ((RETRO_DEVICE_ID_JOYPAD_Y+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_Y] |= ((RETRO_DEVICE_ID_JOYPAD_X+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_A] |= ((RETRO_DEVICE_ID_JOYPAD_B+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_B] |= ((RETRO_DEVICE_ID_JOYPAD_A+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_L1] |= ((RETRO_DEVICE_ID_JOYPAD_L+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_R1] |= ((RETRO_DEVICE_ID_JOYPAD_R+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_L2] |= ((RETRO_DEVICE_ID_JOYPAD_L2+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_R2] |= ((RETRO_DEVICE_ID_JOYPAD_R2+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_THUMBL] |= ((RETRO_DEVICE_ID_JOYPAD_L3+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_THUMBR] |= ((RETRO_DEVICE_ID_JOYPAD_R3+1) << shift);
|
||||
keycode_lut[AKEYCODE_MENU] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift);
|
||||
break;
|
||||
case DEVICE_XPERIA_PLAY:
|
||||
g_settings.input.device[port] = device;
|
||||
strlcpy(g_settings.input.device_names[port], "Xperia Play",
|
||||
|
@ -153,6 +153,8 @@ void input_autodetect_setup (void *data, char *msg, size_t sizeof_msg, unsigned
|
||||
device = DEVICE_MOGA;
|
||||
else if (strstr(name_buf, "Sony Navigation Controller"))
|
||||
device = DEVICE_PSMOVE_NAVI;
|
||||
else if (strstr(name_buf, "OUYA Game Controller"))
|
||||
device = DEVICE_OUYA;
|
||||
else if (strstr(name_buf, "adc joystick"))
|
||||
device = DEVICE_JXD_S7300B;
|
||||
else if (strstr(name_buf, "idroid:con"))
|
||||
|
Loading…
x
Reference in New Issue
Block a user