summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.cpp
diff options
context:
space:
mode:
authorAdmiral H. Curtiss <pikachu025@gmail.com>2024-06-15 15:25:40 +0200
committerGitHub <noreply@github.com>2024-06-15 15:25:40 +0200
commit3f0f5b3b4e12898d34a3a4257be5d8f1e64912c9 (patch)
tree4e439cee59c2938ed8a57f3b6f431e3be46de122 /Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.cpp
parent34f81ad9ac11f7f8b18abe708893fd446c782f81 (diff)
parentc3bdd05d2a7d5c0a5b513481ab929cef66e5249b (diff)
Merge pull request #12815 from Dentomologist/enable_hotkeys_and_controllers_for_focused_tas_input
TAS Input: Enable emulator hotkeys and controller input when TAS Input window has focus
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.cpp')
-rw-r--r--Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.cpp b/Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.cpp
index 3c6a82dcd8..8d7f7c7ada 100644
--- a/Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.cpp
+++ b/Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.cpp
@@ -179,7 +179,8 @@ void KeyboardMouse::UpdateCursorInput()
const auto win_height = std::max(rect.bottom - rect.top, 1l);
POINT point = {};
- if (g_controller_interface.IsMouseCenteringRequested() && Host_RendererHasFocus())
+ if (g_controller_interface.IsMouseCenteringRequested() &&
+ (Host_RendererHasFocus() || Host_TASInputHasFocus()))
{
point.x = win_width / 2;
point.y = win_height / 2;
@@ -189,6 +190,15 @@ void KeyboardMouse::UpdateCursorInput()
SetCursorPos(screen_point.x, screen_point.y);
g_controller_interface.SetMouseCenteringRequested(false);
}
+ else if (Host_TASInputHasFocus())
+ {
+ // When a TAS Input window has focus and "Enable Controller Input" is checked most types of
+ // input should be read normally as if the render window had focus instead. The cursor is an
+ // exception, as otherwise using the mouse to set any control in the TAS Input window will also
+ // update the Wii IR value (or any other input controlled by the cursor).
+
+ return;
+ }
else
{
GetCursorPos(&point);