Ignored the mouse position unless the cursor is over the Dolphin window.
Fixes issue 8673.
This commit is contained in:
parent
81f379b409
commit
f96f90b334
|
@ -126,6 +126,10 @@ void GetMousePos(ControlState* const x, ControlState* const y)
|
|||
GetCursorPos(&point);
|
||||
// Get the cursor position relative to the upper left corner of the current window (separate or render to main)
|
||||
HWND hwnd = WindowFromPoint(point);
|
||||
DWORD processId;
|
||||
GetWindowThreadProcessId(hwnd, &processId);
|
||||
if (processId == GetCurrentProcessId())
|
||||
{
|
||||
ScreenToClient(hwnd, &point);
|
||||
|
||||
// Get the size of the current window. (In my case Rect.top and Rect.left was zero.)
|
||||
|
@ -139,6 +143,12 @@ void GetMousePos(ControlState* const x, ControlState* const y)
|
|||
*x = (ControlState)point.x / (ControlState)win_width * 2 - 1;
|
||||
*y = (ControlState)point.y / (ControlState)win_height * 2 - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
*x = (ControlState)1;
|
||||
*y = (ControlState)1;
|
||||
}
|
||||
}
|
||||
|
||||
void KeyboardMouse::UpdateInput()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue