mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Wiimote: Don't allow input when Dolphin is not in focus (supports both the rendering to main window and render to separate window options)
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2057 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -208,6 +208,9 @@ void FillReportInfo(wm_core& _core)
|
||||
// These keys are reserved for the recording
|
||||
if ( GetAsyncKeyState(VK_SHIFT) || GetAsyncKeyState(VK_CONTROL) ) return;
|
||||
|
||||
// Check that Dolphin is in focus
|
||||
if (!IsFocus()) return;
|
||||
|
||||
// Check the mouse position. Don't allow mouse clicks from outside the window.
|
||||
float x, y; GetMousePos(x, y);
|
||||
bool InsideScreen = !(x < 0 || x > 1 || y < 0 || y > 1);
|
||||
@ -287,6 +290,15 @@ void FillReportAcc(wm_accel& _acc)
|
||||
// ---------------------
|
||||
|
||||
|
||||
// Check that Dolphin is in focus
|
||||
if (!IsFocus())
|
||||
{
|
||||
_acc.x = X;
|
||||
_acc.y = y;
|
||||
_acc.z = z;
|
||||
return;
|
||||
}
|
||||
|
||||
// ------------------------------------
|
||||
// Wiimote to Gamepad translations
|
||||
// ----------
|
||||
@ -768,6 +780,13 @@ void FillReportClassicExtension(wm_classic_extension& _ext)
|
||||
_ext.b2.bB = 0x01;
|
||||
_ext.b2.bZL = 0x01;
|
||||
|
||||
|
||||
// --------------------------------------
|
||||
// Check that Dolphin is in focus
|
||||
if (!IsFocus()) return;
|
||||
// --------------------------------------
|
||||
|
||||
|
||||
// --------------------------------------
|
||||
/* Left and right analog sticks
|
||||
|
||||
|
Reference in New Issue
Block a user