Merge pull request #427 from sgadrat/qt-input-load

fix loading of keyboard mapping for controllers > 1
This commit is contained in:
mjbudd77 2021-12-02 20:31:32 -06:00 committed by GitHub
commit b9e53bbe95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -31,6 +31,7 @@
//#include <unistd.h> //#include <unistd.h>
//#include <fcntl.h> //#include <fcntl.h>
#include <cerrno> #include <cerrno>
#include <cstring>
//#define MAX_JOYSTICKS 32 //#define MAX_JOYSTICKS 32
@ -414,7 +415,7 @@ int GamePad_t::init(int port, const char *guid, const char *profile)
// If we get to this point and still have not found a // If we get to this point and still have not found a
// game controller, then load default keyboard. // game controller, then load default keyboard.
if ((portNum == 0) && (devIdx < 0)) if ((portNum == 0 || strnlen(profile, 1) > 0) && (devIdx < 0))
{ {
if (loadProfile(profile)) if (loadProfile(profile))
{ {