Skip to content

Commit

Permalink
Also call SendMouseDeltaAxis directly from NativeMouseDelta for lower…
Browse files Browse the repository at this point in the history
… latency.
  • Loading branch information
hrydgard committed Dec 14, 2023
1 parent d397635 commit ce6b051
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions UI/NativeApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1324,15 +1324,7 @@ void NativeAxis(const AxisInput *axes, size_t count) {
}
}

void NativeMouseDelta(float dx, float dy) {
// Remap, shared code. Then send it as a regular axis event.
if (!g_Config.bMouseControl)
return;

MouseEventProcessor::ProcessDelta(time_now_d(), dx, dy);
}

// Called from NativeFrame.
// Called from NativeFrame and from NativeMouseDelta.
static void SendMouseDeltaAxis() {
float mx, my;
MouseEventProcessor::MouseDeltaToAxes(time_now_d(), &mx, &my);
Expand All @@ -1356,6 +1348,16 @@ static void SendMouseDeltaAxis() {
}
}

void NativeMouseDelta(float dx, float dy) {
// Remap, shared code. Then send it as a regular axis event.
if (!g_Config.bMouseControl)
return;

MouseEventProcessor::ProcessDelta(time_now_d(), dx, dy);

SendMouseDeltaAxis();
}

void NativeAccelerometer(float tiltX, float tiltY, float tiltZ) {
if (g_Config.iTiltInputType == TILT_NULL) {
// if tilt events are disabled, don't do anything special.
Expand Down

0 comments on commit ce6b051

Please sign in to comment.