Includes attempt to determine if PS3 controller aswell as PS4

This commit is contained in:
Linus Probert 2018-10-12 11:06:01 +02:00
parent 894e3ba551
commit e6b5b761b0
1 changed files with 5 additions and 1 deletions

View File

@ -220,7 +220,11 @@ bool initSDL(void)
if (gController) {
const char *ctrlName = SDL_GameControllerName(gController);
info("Game controller connected: %s", ctrlName);
if (ctrlName[0] == 'P' && ctrlName[1] == 'S' && ctrlName[2] == '4')
// Try to determine if this is a PS3/4 controller
if (ctrlName[0] == 'P' &&
ctrlName[1] == 'S' &&
(ctrlName[2] == '4' || ctrlName[2] == '3'))
controllerMode = 2;
else
controllerMode = 1;