mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-12-03 11:13:44 +01:00
Merge pull request #4458 from Kingcom/KeyStateFix
Correct use of GetAsyncKeyState
This commit is contained in:
commit
ebd3763c7e
4 files changed
+30
-22
No files matched your search
@@ -806,7 +806,7 @@ void CtrlDisAsmView::onKeyDown(WPARAM wParam, LPARAM lParam)
|
||||
u32 windowEnd = windowStart+visibleRows*instructionSize;
|
||||
keyTaken = true;
|
||||
|
||||
if (GetAsyncKeyState(VK_CONTROL))
|
||||
if (KeyDownAsync(VK_CONTROL))
|
||||
{
|
||||
switch (tolower(wParam & 0xFFFF))
|
||||
{
|
||||
@@ -840,28 +840,28 @@ void CtrlDisAsmView::onKeyDown(WPARAM wParam, LPARAM lParam)
|
||||
switch (wParam & 0xFFFF)
|
||||
{
|
||||
case VK_DOWN:
|
||||
setCurAddress(curAddress + instructionSize, GetAsyncKeyState(VK_SHIFT) != 0);
|
||||
setCurAddress(curAddress + instructionSize, KeyDownAsync(VK_SHIFT));
|
||||
scrollAddressIntoView();
|
||||
break;
|
||||
case VK_UP:
|
||||
setCurAddress(curAddress - instructionSize, GetAsyncKeyState(VK_SHIFT) != 0);
|
||||
setCurAddress(curAddress - instructionSize, KeyDownAsync(VK_SHIFT));
|
||||
scrollAddressIntoView();
|
||||
break;
|
||||
case VK_NEXT:
|
||||
if (curAddress != windowEnd - instructionSize && curAddressIsVisible()) {
|
||||
setCurAddress(windowEnd - instructionSize, GetAsyncKeyState(VK_SHIFT) != 0);
|
||||
setCurAddress(windowEnd - instructionSize, GetAsyncKeyState(VK_SHIFT));
|
||||
scrollAddressIntoView();
|
||||
} else {
|
||||
setCurAddress(curAddress + visibleRows * instructionSize, GetAsyncKeyState(VK_SHIFT) != 0);
|
||||
setCurAddress(curAddress + visibleRows * instructionSize, KeyDownAsync(VK_SHIFT));
|
||||
scrollAddressIntoView();
|
||||
}
|
||||
break;
|
||||
case VK_PRIOR:
|
||||
if (curAddress != windowStart && curAddressIsVisible()) {
|
||||
setCurAddress(windowStart, GetAsyncKeyState(VK_SHIFT) != 0);
|
||||
setCurAddress(windowStart, KeyDownAsync(VK_SHIFT));
|
||||
scrollAddressIntoView();
|
||||
} else {
|
||||
setCurAddress(curAddress - visibleRows * instructionSize, GetAsyncKeyState(VK_SHIFT) != 0);
|
||||
setCurAddress(curAddress - visibleRows * instructionSize, KeyDownAsync(VK_SHIFT));
|
||||
scrollAddressIntoView();
|
||||
}
|
||||
break;
|
||||
@@ -961,7 +961,7 @@ void CtrlDisAsmView::onMouseDown(WPARAM wParam, LPARAM lParam, int button)
|
||||
int y = HIWORD(lParam);
|
||||
|
||||
u32 newAddress = yToAddress(y);
|
||||
bool extend = GetAsyncKeyState(VK_SHIFT) != 0;
|
||||
bool extend = KeyDownAsync(VK_SHIFT);
|
||||
if (button == 1)
|
||||
{
|
||||
if (newAddress == curAddress && hasFocus)
|
||||
@@ -987,7 +987,7 @@ void CtrlDisAsmView::onMouseUp(WPARAM wParam, LPARAM lParam, int button)
|
||||
{
|
||||
int x = LOWORD(lParam);
|
||||
int y = HIWORD(lParam);
|
||||
setCurAddress(yToAddress(y), GetAsyncKeyState(VK_SHIFT) != 0);
|
||||
setCurAddress(yToAddress(y), KeyDownAsync(VK_SHIFT));
|
||||
redraw();
|
||||
}
|
||||
else if (button == 2)
|
||||
@@ -1154,7 +1154,7 @@ void CtrlDisAsmView::onMouseMove(WPARAM wParam, LPARAM lParam, int button)
|
||||
{
|
||||
int x = LOWORD(lParam);
|
||||
int y = HIWORD(lParam);
|
||||
setCurAddress(yToAddress(y), GetAsyncKeyState(VK_SHIFT) != 0);
|
||||
setCurAddress(yToAddress(y), KeyDownAsync(VK_SHIFT));
|
||||
// TODO: Perhaps don't do this every time, but on a timer?
|
||||
redraw();
|
||||
}
|
||||
@@ -1289,7 +1289,7 @@ void CtrlDisAsmView::search(bool continueSearch)
|
||||
}
|
||||
|
||||
// cancel search
|
||||
if ((searchAddress % 256) == 0 && GetAsyncKeyState(VK_ESCAPE))
|
||||
if ((searchAddress % 256) == 0 && KeyDownAsync(VK_ESCAPE))
|
||||
{
|
||||
searching = false;
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user