Source/ThirdParty/SDL/src/joystick/SDL_gamecontroller.c
/*
 * Event filter to transform joystick events into appropriate game controller ones
 */
Event filter to transform joystick events into appropriate game controller ones
Event filter to transform joystick events into appropriate game controller ones
int
SDL_PrivateGameControllerAxis(SDL_GameController * gamecontroller, SDL_GameControllerAxis axis, Sint16 value)
{
    int posted;
    posted = 0;
#if !SDL_EVENTS_DISABLED
    if (SDL_GetEventState(SDL_CONTROLLERAXISMOTION) == SDL_ENABLE) {
        SDL_Event event;
        event.type = SDL_CONTROLLERAXISMOTION;
        event.caxis.which = gamecontroller->joystick->instance_id;
        event.caxis.axis = axis;
        event.caxis.value = value;
        posted = SDL_PushEvent(&event) == 1;
    }
#endif 
    return (posted);
}
int SDL_PrivateGameControllerAxis ( SDL_GameController * gamecontroller , SDL_GameControllerAxis axis , Sint16 value ) { int posted ; posted = 0 ; #if ! SDL_EVENTS_DISABLED if ( SDL_GetEventState ( SDL_CONTROLLERAXISMOTION ) == SDL_ENABLE ) { SDL_Event event ; event . type = SDL_CONTROLLERAXISMOTION ; event . caxis . which = gamecontroller -> joystick -> instance_id ; event . caxis . axis = axis ; event . caxis . value = value ; posted = SDL_PushEvent ( & event ) == 1 ; } #endif return ( posted ) ; }
Event filter to transform joystick events into appropriate game controller ones
Event filter to transform joystick events into appropriate game controller ones
/* translate the event, if desired */ /* !SDL_EVENTS_DISABLED */