Files
scrcpy/app/src/hid/hid_mouse.h
Romain Vimont be40ee5dd9 Fix HID mouse support with SDL precise input
Over HID, only integral scroll values can be sent. When SDL precise
scrolling is active, scroll events may include fractional values (e.g.,
0.05), which are truncated to 0 in the HID event.

To fix the problem, use the integral scroll value reported by SDL, which
internally accumulates fractional deltas.

Fixes #6156 <https://github.com/Genymobile/scrcpy/issues/6156>
PR #6172 <https://github.com/Genymobile/scrcpy/pull/6172>
2025-06-20 18:31:24 +02:00

30 lines
759 B
C

#ifndef SC_HID_MOUSE_H
#define SC_HID_MOUSE_H
#include "common.h"
#include "hid/hid_event.h"
#include "input_events.h"
#define SC_HID_ID_MOUSE 2
void
sc_hid_mouse_generate_open(struct sc_hid_open *hid_open);
void
sc_hid_mouse_generate_close(struct sc_hid_close *hid_close);
void
sc_hid_mouse_generate_input_from_motion(struct sc_hid_input *hid_input,
const struct sc_mouse_motion_event *event);
void
sc_hid_mouse_generate_input_from_click(struct sc_hid_input *hid_input,
const struct sc_mouse_click_event *event);
bool
sc_hid_mouse_generate_input_from_scroll(struct sc_hid_input *hid_input,
const struct sc_mouse_scroll_event *event);
#endif