+ // Connect the keyboard device (lowest priority)
+ // N.B.: The keyboard is always mapped to profile #0, so we can locate it
+ // easily. :-)
+ int slot = profile[0].preferredSlot;
+#ifdef DEBUG_PROFILES
+printf("AutoConnect: Attempting to connect keyboard... (gamepadIDSlot1/2 = %i/%i)\n", gamepadIDSlot1, gamepadIDSlot2);
+#endif
+
+ if ((slot == CONTROLLER1) && (gamepadIDSlot1 == -1))
+ controller1Profile = 0;
+ else if ((slot == CONTROLLER2) && (gamepadIDSlot2 == -1))
+ controller2Profile = 0;
+ else if (slot == (CONTROLLER1 | CONTROLLER2))
+ {
+ if (gamepadIDSlot1 == -1)
+ controller1Profile = 0;
+ else if (gamepadIDSlot2 == -1)
+ controller2Profile = 0;
+ }
+
+#ifdef DEBUG_PROFILES
+printf("AutoConnect: Profiles found: [%i, %i]\n", controller1Profile, controller2Profile);
+#endif