src/joystick/android/SDL_sysjoystick.c
changeset 8274 8b1f8feb42a6
parent 8149 681eb46b8ac4
child 8583 fb2933ca805f
equal deleted inserted replaced
8273:bdfea8962bcf 8274:8b1f8feb42a6
   377 
   377 
   378 
   378 
   379 int
   379 int
   380 SDL_SYS_JoystickInit(void)
   380 SDL_SYS_JoystickInit(void)
   381 {
   381 {
   382     const char *env;
   382     const char *hint;
   383     SDL_SYS_JoystickDetect();
   383     SDL_SYS_JoystickDetect();
   384     
   384     
   385     env = SDL_GetHint(SDL_HINT_ACCEL_AS_JOY);
   385     hint = SDL_GetHint(SDL_HINT_ACCELEROMETER_AS_JOYSTICK);
   386     if (!env || SDL_atoi(env)) {
   386     if (!hint || SDL_atoi(hint)) {
   387         /* Default behavior, accelerometer as joystick */
   387         /* Default behavior, accelerometer as joystick */
   388         Android_AddJoystick(ANDROID_ACCELEROMETER_DEVICE_ID, ANDROID_ACCELEROMETER_NAME, SDL_TRUE, 0, 3, 0, 0);
   388         Android_AddJoystick(ANDROID_ACCELEROMETER_DEVICE_ID, ANDROID_ACCELEROMETER_NAME, SDL_TRUE, 0, 3, 0, 0);
   389     }
   389     }
   390    
   390    
   391     return (numjoysticks);
   391     return (numjoysticks);