mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-22 11:18:14 +00:00
Added controller mapping for Android TV remotes
Also fixed the back button on the remote exiting the application
This commit is contained in:
@@ -143,7 +143,13 @@ keycode_to_SDL(int keycode)
|
||||
button = SDL_CONTROLLER_BUTTON_DPAD_RIGHT;
|
||||
break;
|
||||
case AKEYCODE_DPAD_CENTER:
|
||||
button = SDL_CONTROLLER_BUTTON_MAX+4; /* Not supported by GameController */
|
||||
/* This is handled better by applications as the A button */
|
||||
/*button = SDL_CONTROLLER_BUTTON_MAX+4; /* Not supported by GameController */
|
||||
button = SDL_CONTROLLER_BUTTON_A;
|
||||
break;
|
||||
|
||||
case AKEYCODE_BACK:
|
||||
button = SDL_CONTROLLER_BUTTON_B;
|
||||
break;
|
||||
|
||||
/* More gamepad buttons (API 12), these get mapped to 20...35*/
|
||||
@@ -640,6 +646,11 @@ SDL_JoystickGUID SDL_SYS_JoystickGetGUID(SDL_Joystick * joystick)
|
||||
return guid;
|
||||
}
|
||||
|
||||
SDL_bool SDL_SYS_IsDPAD_DeviceIndex(int device_index)
|
||||
{
|
||||
return JoystickByDevIndex(device_index)->naxes == 0;
|
||||
}
|
||||
|
||||
#endif /* SDL_JOYSTICK_ANDROID */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
Reference in New Issue
Block a user