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:
arcum42 2009-05-03 19:30:38 +00:00
parent ee3eca5b34
commit 3a7865ac3f
3 changed files with 20 additions and 11 deletions

View File

@ -317,6 +317,7 @@ int _GetJoystickIdFromPAD(int pad)
} }
} }
} }
return joyid;
} }
void CALLBACK PADupdate(int pad) void CALLBACK PADupdate(int pad)
@ -382,9 +383,10 @@ void CALLBACK PADupdate(int pad)
#endif #endif
i = FindKey(key, pad); i = FindKey(key, pad);
keyPress |= (1 << i); if (i != -1) {
keyRelease &= ~(1 << i); keyPress |= (1 << i);
keyRelease &= ~(1 << i);
}
event.evt = KEYPRESS; event.evt = KEYPRESS;
event.key = key; event.key = key;
break; break;
@ -423,8 +425,10 @@ void CALLBACK PADupdate(int pad)
#endif #endif
i = FindKey(key, pad); i = FindKey(key, pad);
keyPress &= ~(1 << i); if (i != -1) {
keyRelease |= (1 << i); keyPress &= ~(1 << i);
keyRelease |= (1 << i);
}
event.evt = KEYRELEASE; event.evt = KEYRELEASE;
event.key = key; event.key = key;
break; break;

View File

@ -190,17 +190,21 @@ LRESULT WINAPI PADwndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
if (lParam & 0x40000000) if (lParam & 0x40000000)
return TRUE; return TRUE;
i = FindKey(wparam, pad); i = FindKey(wParam, pad);
keyPress[pad] |= (1 << i); if (i != -1) {
keyRelease[pad] &= ~(1 << i); keyPress[pad] |= (1 << i);
keyRelease[pad] &= ~(1 << i);
}
event.evt = KEYPRESS; event.evt = KEYPRESS;
event.key = wParam; event.key = wParam;
break; break;
case WM_KEYUP: case WM_KEYUP:
i = FindKey(wparam, pad); i = FindKey(wParam, pad);
keyPress[pad] &= ~(1 << i); if (i != -1) {
keyRelease[pad] |= (1 << i); keyPress[pad] &= ~(1 << i);
keyRelease[pad] |= (1 << i);
}
event.evt = KEYRELEASE; event.evt = KEYRELEASE;
event.key = wParam; event.key = wParam;
break; break;

View File

@ -162,6 +162,7 @@ inline int FindKey(int key, int pad)
for (int p = 0; p < PADSUBKEYS; p++) for (int p = 0; p < PADSUBKEYS; p++)
for (int i = 0; i < PADKEYS; i++) for (int i = 0; i < PADKEYS; i++)
if (key == conf.keys[(PadEnum[pad][p])][i]) return i; if (key == conf.keys[(PadEnum[pad][p])][i]) return i;
return -1;
} }
#endif #endif