From e6b5b761b0e54b2adf0e1de07c7a786e9a3a437c Mon Sep 17 00:00:00 2001 From: Linus Probert Date: Fri, 12 Oct 2018 11:06:01 +0200 Subject: [PATCH] Includes attempt to determine if PS3 controller aswell as PS4 --- src/main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index b37fbe9..b3203e8 100644 --- a/src/main.c +++ b/src/main.c @@ -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;