Includes attempt to determine if PS3 controller aswell as PS4
This commit is contained in:
parent
894e3ba551
commit
e6b5b761b0
|
@ -220,7 +220,11 @@ bool initSDL(void)
|
||||||
if (gController) {
|
if (gController) {
|
||||||
const char *ctrlName = SDL_GameControllerName(gController);
|
const char *ctrlName = SDL_GameControllerName(gController);
|
||||||
info("Game controller connected: %s", ctrlName);
|
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;
|
controllerMode = 2;
|
||||||
else
|
else
|
||||||
controllerMode = 1;
|
controllerMode = 1;
|
||||||
|
|
Loading…
Reference in New Issue