src/joystick/android/SDL_sysjoystick.c
changeset 8013 109299fe73ad
parent 8008 5e5819ca19db
child 8024 ffbdb99af7bd
equal deleted inserted replaced
8012:6516c66db5c9 8013:109299fe73ad
   126         case AKEYCODE_BUTTON_16:
   126         case AKEYCODE_BUTTON_16:
   127             button = keycode - AKEYCODE_BUTTON_1 + 20;
   127             button = keycode - AKEYCODE_BUTTON_1 + 20;
   128             break;
   128             break;
   129             
   129             
   130         default:
   130         default:
   131             SDL_Log("The button you just pressed is not recognized by SDL. To help get this fixed, please report this to the SDL mailing list <sdl@libsdl.org> Android KeyCode %d", keycode);
       
   132             return -1;
   131             return -1;
   133             break;
   132             break;
   134     }
   133     }
   135     
   134     
   136     /* This is here in case future generations, probably with six fingers per hand, 
   135     /* This is here in case future generations, probably with six fingers per hand, 
   311 Android_OnPadDown(int padId, int keycode)
   310 Android_OnPadDown(int padId, int keycode)
   312 {
   311 {
   313     int button = keycode_to_SDL(keycode);
   312     int button = keycode_to_SDL(keycode);
   314     if (button >= 0) {
   313     if (button >= 0) {
   315         SDL_PrivateJoystickButton(SYS_Joysticks[padId], button , SDL_PRESSED);
   314         SDL_PrivateJoystickButton(SYS_Joysticks[padId], button , SDL_PRESSED);
   316     }
   315         return 0;
   317     
   316     }
   318     return 0;
   317     
       
   318     return -1;
   319 }
   319 }
   320 
   320 
   321 int
   321 int
   322 Android_OnPadUp(int padId, int keycode)
   322 Android_OnPadUp(int padId, int keycode)
   323 {
   323 {
   324     int button = keycode_to_SDL(keycode);
   324     int button = keycode_to_SDL(keycode);
   325     if (button >= 0) {
   325     if (button >= 0) {
   326         SDL_PrivateJoystickButton(SYS_Joysticks[padId], button, SDL_RELEASED);
   326         SDL_PrivateJoystickButton(SYS_Joysticks[padId], button, SDL_RELEASED);
   327     }
   327         return 0;
   328     
   328     }
   329     return 0;
   329     
       
   330     return -1;
   330 }
   331 }
   331 
   332 
   332 int
   333 int
   333 Android_OnJoy(int joyId, int axis, float value)
   334 Android_OnJoy(int joyId, int axis, float value)
   334 {
   335 {