mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2025-08-18 01:15:46 +00:00
Specify signedness behavior of char in the API. Fixes backwards scrolling on Rasbian where char is unsigned by default
This commit is contained in:
parent
a5f59d206e
commit
3a9e37832a
@ -42,8 +42,8 @@ typedef struct _NV_CONTROLLER_PACKET {
|
|||||||
int headerA;
|
int headerA;
|
||||||
short headerB;
|
short headerB;
|
||||||
short buttonFlags;
|
short buttonFlags;
|
||||||
char leftTrigger;
|
unsigned char leftTrigger;
|
||||||
char rightTrigger;
|
unsigned char rightTrigger;
|
||||||
short leftStickX;
|
short leftStickX;
|
||||||
short leftStickY;
|
short leftStickY;
|
||||||
short rightStickX;
|
short rightStickX;
|
||||||
@ -67,8 +67,8 @@ typedef struct _NV_MULTI_CONTROLLER_PACKET {
|
|||||||
short midA;
|
short midA;
|
||||||
short midB;
|
short midB;
|
||||||
short buttonFlags;
|
short buttonFlags;
|
||||||
char leftTrigger;
|
unsigned char leftTrigger;
|
||||||
char rightTrigger;
|
unsigned char rightTrigger;
|
||||||
short leftStickX;
|
short leftStickX;
|
||||||
short leftStickY;
|
short leftStickY;
|
||||||
short rightStickX;
|
short rightStickX;
|
||||||
@ -89,4 +89,4 @@ typedef struct _NV_SCROLL_PACKET {
|
|||||||
short zero3;
|
short zero3;
|
||||||
} NV_SCROLL_PACKET, *PNV_SCROLL_PACKET;
|
} NV_SCROLL_PACKET, *PNV_SCROLL_PACKET;
|
||||||
|
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
@ -387,7 +387,7 @@ int LiSendKeyboardEvent(short keyCode, char keyAction, char modifiers) {
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int sendControllerEventInternal(short controllerNumber, short buttonFlags, char leftTrigger, char rightTrigger,
|
static int sendControllerEventInternal(short controllerNumber, short buttonFlags, unsigned char leftTrigger, unsigned char rightTrigger,
|
||||||
short leftStickX, short leftStickY, short rightStickX, short rightStickY)
|
short leftStickX, short leftStickY, short rightStickX, short rightStickY)
|
||||||
{
|
{
|
||||||
PPACKET_HOLDER holder;
|
PPACKET_HOLDER holder;
|
||||||
@ -448,7 +448,7 @@ static int sendControllerEventInternal(short controllerNumber, short buttonFlags
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Send a controller event to the streaming machine */
|
/* Send a controller event to the streaming machine */
|
||||||
int LiSendControllerEvent(short buttonFlags, char leftTrigger, char rightTrigger,
|
int LiSendControllerEvent(short buttonFlags, unsigned char leftTrigger, unsigned char rightTrigger,
|
||||||
short leftStickX, short leftStickY, short rightStickX, short rightStickY)
|
short leftStickX, short leftStickY, short rightStickX, short rightStickY)
|
||||||
{
|
{
|
||||||
return sendControllerEventInternal(0, buttonFlags, leftTrigger, rightTrigger,
|
return sendControllerEventInternal(0, buttonFlags, leftTrigger, rightTrigger,
|
||||||
@ -456,7 +456,7 @@ int LiSendControllerEvent(short buttonFlags, char leftTrigger, char rightTrigger
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Send a controller event to the streaming machine */
|
/* Send a controller event to the streaming machine */
|
||||||
int LiSendMultiControllerEvent(short controllerNumber, short buttonFlags, char leftTrigger, char rightTrigger,
|
int LiSendMultiControllerEvent(short controllerNumber, short buttonFlags, unsigned char leftTrigger, unsigned char rightTrigger,
|
||||||
short leftStickX, short leftStickY, short rightStickX, short rightStickY)
|
short leftStickX, short leftStickY, short rightStickX, short rightStickY)
|
||||||
{
|
{
|
||||||
return sendControllerEventInternal(controllerNumber, buttonFlags, leftTrigger, rightTrigger,
|
return sendControllerEventInternal(controllerNumber, buttonFlags, leftTrigger, rightTrigger,
|
||||||
@ -464,7 +464,7 @@ int LiSendMultiControllerEvent(short controllerNumber, short buttonFlags, char l
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Send a scroll event to the streaming machine */
|
/* Send a scroll event to the streaming machine */
|
||||||
int LiSendScrollEvent(char scrollClicks) {
|
int LiSendScrollEvent(signed char scrollClicks) {
|
||||||
PPACKET_HOLDER holder;
|
PPACKET_HOLDER holder;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
@ -492,4 +492,4 @@ int LiSendScrollEvent(char scrollClicks) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
@ -206,18 +206,18 @@ int LiSendKeyboardEvent(short keyCode, char keyAction, char modifiers);
|
|||||||
|
|
||||||
// This function queues a controller event to be sent to the remote server. It will
|
// This function queues a controller event to be sent to the remote server. It will
|
||||||
// be seen by the computer as the first controller.
|
// be seen by the computer as the first controller.
|
||||||
int LiSendControllerEvent(short buttonFlags, char leftTrigger, char rightTrigger,
|
int LiSendControllerEvent(short buttonFlags, unsigned char leftTrigger, unsigned char rightTrigger,
|
||||||
short leftStickX, short leftStickY, short rightStickX, short rightStickY);
|
short leftStickX, short leftStickY, short rightStickX, short rightStickY);
|
||||||
|
|
||||||
// This function queues a controller event to be sent to the remote server. The controllerNumber
|
// This function queues a controller event to be sent to the remote server. The controllerNumber
|
||||||
// parameter is a zero-based index of which controller this event corresponds to. The largest legal
|
// parameter is a zero-based index of which controller this event corresponds to. The largest legal
|
||||||
// controller number is 3 (for a total of 4 controllers, the Xinput maximum). On generation 3 servers (GFE 2.1.x),
|
// controller number is 3 (for a total of 4 controllers, the Xinput maximum). On generation 3 servers (GFE 2.1.x),
|
||||||
// these will be sent as controller 0 regardless of the controllerNumber parameter.
|
// these will be sent as controller 0 regardless of the controllerNumber parameter.
|
||||||
int LiSendMultiControllerEvent(short controllerNumber, short buttonFlags, char leftTrigger, char rightTrigger,
|
int LiSendMultiControllerEvent(short controllerNumber, short buttonFlags, unsigned char leftTrigger, unsigned char rightTrigger,
|
||||||
short leftStickX, short leftStickY, short rightStickX, short rightStickY);
|
short leftStickX, short leftStickY, short rightStickX, short rightStickY);
|
||||||
|
|
||||||
// This function queues a vertical scroll event to the remote server.
|
// This function queues a vertical scroll event to the remote server.
|
||||||
int LiSendScrollEvent(char scrollClicks);
|
int LiSendScrollEvent(signed char scrollClicks);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user