src/joystick/android/SDL_sysjoystick.c
changeset 11671 3dc400fafd76
parent 11663 0d96acbd34f0
child 11778 db38a635e2c6
equal deleted inserted replaced
11670:cb780bb5093a 11671:3dc400fafd76
   458     /* Support for device connect/disconnect is API >= 16 only,
   458     /* Support for device connect/disconnect is API >= 16 only,
   459      * so we poll every three seconds
   459      * so we poll every three seconds
   460      * Ref: http://developer.android.com/reference/android/hardware/input/InputManager.InputDeviceListener.html
   460      * Ref: http://developer.android.com/reference/android/hardware/input/InputManager.InputDeviceListener.html
   461      */
   461      */
   462     static Uint32 timeout = 0;
   462     static Uint32 timeout = 0;
   463     if (SDL_TICKS_PASSED(SDL_GetTicks(), timeout)) {
   463     if (!timeout || SDL_TICKS_PASSED(SDL_GetTicks(), timeout)) {
   464         timeout = SDL_GetTicks() + 3000;
   464         timeout = SDL_GetTicks() + 3000;
   465         Android_JNI_PollInputDevices();
   465         Android_JNI_PollInputDevices();
   466     }
   466     }
   467 
   467 
   468     SDL_UpdateSteamControllers();
   468     SDL_UpdateSteamControllers();