Also call SendMouseDeltaAxis directly from NativeMouseDelta for lower latency.

This commit is contained in:
Henrik Rydgård 2023-12-14 19:30:03 +01:00
parent d397635e49
commit ce6b05174a

View file

@ -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);
@ -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.