Update Joystick.cpp

This commit is contained in:
dabonetn 2015-11-02 14:41:06 -05:00
parent 417e994b8f
commit 472071737d
1 changed files with 14 additions and 4 deletions

View File

@ -122,17 +122,27 @@ DWORD joy1axis0 = 0;
DWORD joy1axis1 = 1;
DWORD joy2axis0 = 0;
DWORD joy2axis1 = 1;
DWORD joyexitenable = 0;
DWORD joyexitbutton0 = 8;
DWORD joyexitbutton1 = 9;
bool joyquitevent = 0;
SDL_Joystick *joy1 = NULL;
SDL_Joystick *joy2 = NULL;
//===========================================================================
void CheckJoyExit()
{
SDL_JoystickUpdate(); // update all joysticks states
if (SDL_JoystickGetButton(joy1,joyexitbutton0) && SDL_JoystickGetButton(joy1,joyexitbutton1)) joyquitevent = true;
else joyquitevent = false;
}
void CheckJoystick0 ()
{
if(!joy1) return; // if no joystick#1 then everything will be useless
static DWORD lastcheck = 0;
DWORD currtime = GetTickCount();