G'day! Today I purchased a third gamepad so I can test 3 gamepads in KarBOOM, and it doesn't work. The gamepads all work individually, but only 2 gamepads work. I know A8 only has built-in support for 2 gamepads, but I'm not using the built-in functions at all -- I'm using Windows functions for
all gamepad reading.
I use
joySetCapture,
joyReleaseCapture, and
joyGetPosEx. These all work great for the first 2 gamepads, and for some reason don't work after that.
Does anyone have experience with using more than 2 gamepads?
Also, can anyone recall if they've used "recapture gamepads" in KarBOOM to use gamepads that were connected
after starting the game? I know I tested it and it worked when I first implemented it, but now when I try an recapture gamepads it loses all of them.
At game start I have this:
for (i=0; i<MAX_JOYSTICKS; i++) {
hasJoystick[i] = (var)joySetCapture(hWnd, i, POLLING_PERIOD, JOYSTICKS_CHANGED);
joystick[0] = JOYSTICK_SIZE;
joystick[1] = JOY_CAL_READ5;
if (hasJoystick[i] == 0)
joyGetPosEx(i, (void*)joystick);
}
It captures and calibrates the joysticks.
I recapture joysticks with this:
function joyRecapture() {
var i;
for (i=0; i<MAX_JOYSTICKS; i++) {
joyReleaseCapture(i);
hasJoystick[i] = (var)joySetCapture(hWnd, i, POLLING_PERIOD, JOYSTICKS_CHANGED);
joystick[0] = JOYSTICK_SIZE;
joystick[1] = JOY_CAL_READ5;
if (hasJoystick[i] == 0)
joyGetPosEx(i, (void*)joystick);
}
}
And it used to work great. Now it just releases all the joysticks and gets none of them back.
Jibb