mirror of https://github.com/PCSX2/pcsx2.git
ZeroPad: Patch to fix a bug introduced in r1125.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1128 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
ee3eca5b34
commit
3a7865ac3f
|
@ -317,6 +317,7 @@ int _GetJoystickIdFromPAD(int pad)
|
|||
}
|
||||
}
|
||||
}
|
||||
return joyid;
|
||||
}
|
||||
|
||||
void CALLBACK PADupdate(int pad)
|
||||
|
@ -382,9 +383,10 @@ void CALLBACK PADupdate(int pad)
|
|||
#endif
|
||||
|
||||
i = FindKey(key, pad);
|
||||
keyPress |= (1 << i);
|
||||
keyRelease &= ~(1 << i);
|
||||
|
||||
if (i != -1) {
|
||||
keyPress |= (1 << i);
|
||||
keyRelease &= ~(1 << i);
|
||||
}
|
||||
event.evt = KEYPRESS;
|
||||
event.key = key;
|
||||
break;
|
||||
|
@ -423,8 +425,10 @@ void CALLBACK PADupdate(int pad)
|
|||
#endif
|
||||
|
||||
i = FindKey(key, pad);
|
||||
keyPress &= ~(1 << i);
|
||||
keyRelease |= (1 << i);
|
||||
if (i != -1) {
|
||||
keyPress &= ~(1 << i);
|
||||
keyRelease |= (1 << i);
|
||||
}
|
||||
event.evt = KEYRELEASE;
|
||||
event.key = key;
|
||||
break;
|
||||
|
|
|
@ -190,17 +190,21 @@ LRESULT WINAPI PADwndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||
if (lParam & 0x40000000)
|
||||
return TRUE;
|
||||
|
||||
i = FindKey(wparam, pad);
|
||||
keyPress[pad] |= (1 << i);
|
||||
keyRelease[pad] &= ~(1 << i);
|
||||
i = FindKey(wParam, pad);
|
||||
if (i != -1) {
|
||||
keyPress[pad] |= (1 << i);
|
||||
keyRelease[pad] &= ~(1 << i);
|
||||
}
|
||||
event.evt = KEYPRESS;
|
||||
event.key = wParam;
|
||||
break;
|
||||
|
||||
case WM_KEYUP:
|
||||
i = FindKey(wparam, pad);
|
||||
keyPress[pad] &= ~(1 << i);
|
||||
keyRelease[pad] |= (1 << i);
|
||||
i = FindKey(wParam, pad);
|
||||
if (i != -1) {
|
||||
keyPress[pad] &= ~(1 << i);
|
||||
keyRelease[pad] |= (1 << i);
|
||||
}
|
||||
event.evt = KEYRELEASE;
|
||||
event.key = wParam;
|
||||
break;
|
||||
|
|
|
@ -162,6 +162,7 @@ inline int FindKey(int key, int pad)
|
|||
for (int p = 0; p < PADSUBKEYS; p++)
|
||||
for (int i = 0; i < PADKEYS; i++)
|
||||
if (key == conf.keys[(PadEnum[pad][p])][i]) return i;
|
||||
return -1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue