Пример #1
0
 PeripheralEvent(unsigned int peripheralIndex, unsigned int hatIndex, JOYSTICK_STATE_HAT state) :
     m_event()
 {
     SetType(PERIPHERAL_EVENT_TYPE_DRIVER_HAT);
     SetPeripheralIndex(peripheralIndex);
     SetDriverIndex(hatIndex);
     SetHatState(state);
 }
Пример #2
0
void JoystickInfo::SaveState()
{
    for (int i = 0; i < numbuttons; ++i)
        SetButtonState(i, SDL_JoystickGetButton(joy, i));
    for (int i = 0; i < numaxes; ++i)
        SetAxisState(i, SDL_JoystickGetAxis(joy, i));
    for (int i = 0; i < numhats; ++i)
        SetHatState(i, SDL_JoystickGetHat(joy, i));
}