mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-09-11 07:03:33 +02:00
Add an option to trap mouse within window/display area.
This commit is contained in:
@@ -233,12 +233,20 @@ namespace MainWindow
|
||||
while (cursorCounter >= 0) {
|
||||
cursorCounter = ShowCursor(FALSE);
|
||||
}
|
||||
if (g_Config.bMouseConfine) {
|
||||
RECT rc;
|
||||
GetClientRect(hwndDisplay, &rc);
|
||||
ClientToScreen(hwndDisplay, reinterpret_cast<POINT*>(&rc.left));
|
||||
ClientToScreen(hwndDisplay, reinterpret_cast<POINT*>(&rc.right));
|
||||
ClipCursor(&rc);
|
||||
}
|
||||
} else {
|
||||
hideCursor = !autoHide;
|
||||
if (cursorCounter < 0) {
|
||||
cursorCounter = ShowCursor(TRUE);
|
||||
SetCursor(LoadCursor(NULL, IDC_ARROW));
|
||||
}
|
||||
ClipCursor(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user