mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2025-08-18 01:15:46 +00:00
Add support for high-resolution scroll events
This commit is contained in:
parent
708a513256
commit
8755529b1a
@ -599,8 +599,8 @@ int LiSendMultiControllerEvent(short controllerNumber, short activeGamepadMask,
|
||||
leftStickX, leftStickY, rightStickX, rightStickY);
|
||||
}
|
||||
|
||||
// Send a scroll event to the streaming machine
|
||||
int LiSendScrollEvent(signed char scrollClicks) {
|
||||
// Send a high resolution scroll event to the streaming machine
|
||||
int LiSendHighResScrollEvent(short scrollAmount) {
|
||||
PPACKET_HOLDER holder;
|
||||
int err;
|
||||
|
||||
@ -622,7 +622,7 @@ int LiSendScrollEvent(signed char scrollClicks) {
|
||||
}
|
||||
holder->packet.scroll.zero1 = 0;
|
||||
holder->packet.scroll.zero2 = 0;
|
||||
holder->packet.scroll.scrollAmt1 = htons(scrollClicks * 120);
|
||||
holder->packet.scroll.scrollAmt1 = htons(scrollAmount);
|
||||
holder->packet.scroll.scrollAmt2 = holder->packet.scroll.scrollAmt1;
|
||||
holder->packet.scroll.zero3 = 0;
|
||||
|
||||
@ -633,3 +633,8 @@ int LiSendScrollEvent(signed char scrollClicks) {
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
// Send a scroll event to the streaming machine
|
||||
int LiSendScrollEvent(signed char scrollClicks) {
|
||||
return LiSendHighResScrollEvent(scrollClicks * 120);
|
||||
}
|
||||
|
@ -416,8 +416,16 @@ int LiSendMultiControllerEvent(short controllerNumber, short activeGamepadMask,
|
||||
short leftStickX, short leftStickY, short rightStickX, short rightStickY);
|
||||
|
||||
// This function queues a vertical scroll event to the remote server.
|
||||
// The number of "clicks" is multiplied by WHEEL_DELTA (120) before
|
||||
// being sent to the PC.
|
||||
int LiSendScrollEvent(signed char scrollClicks);
|
||||
|
||||
// This function queues a vertical scroll event to the remote server.
|
||||
// Unlike LiSendScrollEvent(), this function can send wheel events
|
||||
// smaller than 120 units for devices that support "high resolution"
|
||||
// scrolling (Apple Trackpads, Microsoft Precision Touchpads, etc.).
|
||||
int LiSendHighResScrollEvent(short scrollAmount);
|
||||
|
||||
// This function returns a time in milliseconds with an implementation-defined epoch.
|
||||
// NOTE: This will be populated from gettimeofday() if !HAVE_CLOCK_GETTIME and
|
||||
// populated from clock_gettime(CLOCK_MONOTONIC) if HAVE_CLOCK_GETTIME.
|
||||
|
Loading…
x
Reference in New Issue
Block a user