Joystick controller fixes

- only poll for joystick connectivity once per second
    - if keypad joystick enabled, pump the handler
This commit is contained in:
Aaron Culliney 2014-12-01 22:39:46 -08:00
parent 575bb2448b
commit 5c6c66f243

View File

@ -92,6 +92,10 @@ void gldriver_joystick_reset(void) {
- (void)connectivityPoll:(NSNotification *)notification
{
static unsigned int counter = 0;
counter = (counter+1) % 60;
if (counter == 0)
{
NSArray *joysticks = [DDHidJoystick allJoysticks];
BOOL changed = ([joysticks count] != [self.allJoysticks count]);
for (DDHidJoystick *joystick in joysticks)
@ -107,6 +111,13 @@ void gldriver_joystick_reset(void) {
{
[self resetJoysticks];
}
}
#ifdef KEYPAD_JOYSTICK
if (joy_mode == JOY_KPAD)
{
c_keys_handle_input(-1, 0, 0);
}
#endif
}
#pragma mark -