diff options
| author | Admiral H. Curtiss <pikachu025@gmail.com> | 2023-01-02 23:04:12 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-02 23:04:12 +0100 |
| commit | d949aa60bbe2fa9ccce9b714d888151fdf97695a (patch) | |
| tree | 7225665235dc6c527d4c9cf5a4fccf4b41ee49df /Source/Core | |
| parent | f13f54e3db532fe308dfaee5a94bcc50fbd1e175 (diff) | |
| parent | 8659de4d713ead782bf4a81a2ab94688b30b9c46 (diff) | |
Merge pull request #11397 from TellowKrinkle/QuartzMousePos
InputCommon:QuartzKB&M: Fix mouse y coordinates
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/InputCommon/ControllerInterface/Quartz/QuartzKeyboardAndMouse.mm | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/Quartz/QuartzKeyboardAndMouse.mm b/Source/Core/InputCommon/ControllerInterface/Quartz/QuartzKeyboardAndMouse.mm index a610956d93..5ea4ff2624 100644 --- a/Source/Core/InputCommon/ControllerInterface/Quartz/QuartzKeyboardAndMouse.mm +++ b/Source/Core/InputCommon/ControllerInterface/Quartz/QuartzKeyboardAndMouse.mm @@ -259,16 +259,14 @@ void KeyboardAndMouse::UpdateInput() } else { - CGEventRef event = CGEventCreate(nil); - CGPoint loc = CGEventGetLocation(event); - CFRelease(event); + NSPoint loc = [NSEvent mouseLocation]; const auto window_scale = g_controller_interface.GetWindowInputScale(); loc.x -= bounds.origin.x; loc.y -= bounds.origin.y; m_cursor.x = (loc.x / window_width * 2 - 1.0) * window_scale.x; - m_cursor.y = (loc.y / window_height * 2 - 1.0) * window_scale.y; + m_cursor.y = (loc.y / window_height * 2 - 1.0) * -window_scale.y; } } |
