Merge pull request #2036 from pcca-matrix/develop
Fix Random input in N-Rage Plugin (https://github.com/project64/proje…
This commit is contained in:
commit
09e4a6d211
|
@ -163,6 +163,7 @@ void AxisDeadzone( SHORT &AxisValue, long lDeadZoneValue, float fDeadZoneRelati
|
||||||
|
|
||||||
void GetXInputControllerKeys( const int indexController, LPDWORD Keys )
|
void GetXInputControllerKeys( const int indexController, LPDWORD Keys )
|
||||||
{
|
{
|
||||||
|
|
||||||
if (fnXInputGetState == NULL)
|
if (fnXInputGetState == NULL)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -178,13 +179,13 @@ void GetXInputControllerKeys( const int indexController, LPDWORD Keys )
|
||||||
if ( !gController->bConfigured )
|
if ( !gController->bConfigured )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
DWORD result;
|
||||||
|
XINPUT_STATE state;
|
||||||
|
|
||||||
ULONGLONG time = GetTickCount() / 1000;
|
ULONGLONG time = GetTickCount() / 1000;
|
||||||
if (g_pcControllers[indexController].XcheckTime != NULL && (time - g_pcControllers[indexController].XcheckTime) < 3)
|
if (g_pcControllers[indexController].XcheckTime != NULL && (time - g_pcControllers[indexController].XcheckTime) < 3)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
DWORD result;
|
|
||||||
XINPUT_STATE state;
|
|
||||||
|
|
||||||
result = fnXInputGetState(gController->nControl, &state);
|
result = fnXInputGetState(gController->nControl, &state);
|
||||||
|
|
||||||
if (result == ERROR_DEVICE_NOT_CONNECTED) {
|
if (result == ERROR_DEVICE_NOT_CONNECTED) {
|
||||||
|
@ -194,6 +195,9 @@ void GetXInputControllerKeys( const int indexController, LPDWORD Keys )
|
||||||
g_pcControllers[indexController].XcheckTime = NULL;
|
g_pcControllers[indexController].XcheckTime = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( result != ERROR_SUCCESS )
|
||||||
|
return;
|
||||||
|
|
||||||
DWORD wButtons = state.Gamepad.wButtons;
|
DWORD wButtons = state.Gamepad.wButtons;
|
||||||
|
|
||||||
if( pcController->bPadDeadZone > 0 )
|
if( pcController->bPadDeadZone > 0 )
|
||||||
|
|
Loading…
Reference in New Issue