示例#1
0
 PeripheralEvent(unsigned int peripheralIndex, unsigned int axisIndex, JOYSTICK_STATE_AXIS state) :
     m_event()
 {
     SetType(PERIPHERAL_EVENT_TYPE_DRIVER_AXIS);
     SetPeripheralIndex(peripheralIndex);
     SetDriverIndex(axisIndex);
     SetAxisState(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));
}