diff --git a/src/InputStream.c b/src/InputStream.c index 4855965..cfb9e10 100644 --- a/src/InputStream.c +++ b/src/InputStream.c @@ -1226,7 +1226,7 @@ int LiSendTouchEvent(uint8_t eventType, uint32_t pointerId, float x, float y, fl } // This is a protocol extension only supported with Sunshine - if (!(SunshineFeatureFlags & SS_FF_PEN_TOUCH_EVENTS)) { + if (!(SunshineFeatureFlags & LI_FF_PEN_TOUCH_EVENTS)) { return LI_ERR_UNSUPPORTED; } @@ -1275,7 +1275,7 @@ int LiSendPenEvent(uint8_t eventType, uint8_t toolType, uint8_t penButtons, } // This is a protocol extension only supported with Sunshine - if (!(SunshineFeatureFlags & SS_FF_PEN_TOUCH_EVENTS)) { + if (!(SunshineFeatureFlags & LI_FF_PEN_TOUCH_EVENTS)) { return LI_ERR_UNSUPPORTED; } @@ -1368,7 +1368,7 @@ int LiSendControllerTouchEvent(uint8_t controllerNumber, uint8_t eventType, uint } // This is a protocol extension only supported with Sunshine - if (!(SunshineFeatureFlags & SS_FF_CONTROLLER_TOUCH_EVENTS)) { + if (!(SunshineFeatureFlags & LI_FF_CONTROLLER_TOUCH_EVENTS)) { return LI_ERR_UNSUPPORTED; } @@ -1416,7 +1416,7 @@ int LiSendControllerMotionEvent(uint8_t controllerNumber, uint8_t motionType, fl } // This is a protocol extension only supported with Sunshine - if (!(SunshineFeatureFlags & SS_FF_CONTROLLER_TOUCH_EVENTS)) { + if (!(SunshineFeatureFlags & LI_FF_CONTROLLER_TOUCH_EVENTS)) { return LI_ERR_UNSUPPORTED; } diff --git a/src/Limelight-internal.h b/src/Limelight-internal.h index 160ff46..8647dbd 100644 --- a/src/Limelight-internal.h +++ b/src/Limelight-internal.h @@ -41,8 +41,6 @@ extern uint16_t VideoPortNumber; extern SS_PING AudioPingPayload; extern SS_PING VideoPingPayload; -#define SS_FF_PEN_TOUCH_EVENTS 0x01 -#define SS_FF_CONTROLLER_TOUCH_EVENTS 0x02 extern uint32_t SunshineFeatureFlags; // ENet channel ID values diff --git a/src/Limelight.h b/src/Limelight.h index 7453b7d..bc940e7 100644 --- a/src/Limelight.h +++ b/src/Limelight.h @@ -624,6 +624,9 @@ int LiSendMouseMoveAsMousePositionEvent(short deltaX, short deltaY, short refere // // If unsupported by the host, this will return LI_ERR_UNSUPPORTED and the caller should consider // falling back to other functions to send this input (such as LiSendMousePositionEvent()). +// +// To determine if LiSendTouchEvent() is supported without calling it, call LiGetHostFeatureFlags() +// and check for the LI_FF_PEN_TOUCH_EVENTS flag. #define LI_TOUCH_EVENT_HOVER 0x00 #define LI_TOUCH_EVENT_DOWN 0x01 #define LI_TOUCH_EVENT_UP 0x02 @@ -642,6 +645,9 @@ int LiSendTouchEvent(uint8_t eventType, uint32_t pointerId, float x, float y, fl // // x, y, pressure, rotation, contact area, and tilt are ignored for LI_TOUCH_EVENT_BUTTON_ONLY events. // If one of those changes, send LI_TOUCH_EVENT_MOVE or LI_TOUCH_EVENT_HOVER instead. +// +// To determine if LiSendPenEvent() is supported without calling it, call LiGetHostFeatureFlags() +// and check for the LI_FF_PEN_TOUCH_EVENTS flag. #define LI_TOOL_TYPE_UNKNOWN 0x00 #define LI_TOOL_TYPE_PEN 0x01 #define LI_TOOL_TYPE_ERASER 0x02 @@ -762,6 +768,9 @@ int LiSendControllerArrivalEvent(uint8_t controllerNumber, uint16_t activeGamepa // // If unsupported by the host, this will return LI_ERR_UNSUPPORTED and the caller should consider // using this touch input to simulate trackpad input. +// +// To determine if LiSendControllerTouchEvent() is supported without calling it, call LiGetHostFeatureFlags() +// and check for the LI_FF_CONTROLLER_TOUCH_EVENTS flag. int LiSendControllerTouchEvent(uint8_t controllerNumber, uint8_t eventType, uint32_t pointerId, float x, float y, float pressure); // This function allows clients to send controller-associated motion events to a supported host. @@ -934,6 +943,11 @@ bool LiGetHdrMetadata(PSS_HDR_METADATA metadata); // frame, just that an IDR frame will arrive soon. void LiRequestIdrFrame(void); +// This function returns any extended feature flags supported by the host. +#define LI_FF_PEN_TOUCH_EVENTS 0x01 // LiSendTouchEvent()/LiSendPenEvent() supported +#define LI_FF_CONTROLLER_TOUCH_EVENTS 0x02 // LiSendControllerTouchEvent() supported +uint32_t LiGetHostFeatureFlags(void); + #ifdef __cplusplus } #endif diff --git a/src/Misc.c b/src/Misc.c index 8c3c553..da56fa0 100644 --- a/src/Misc.c +++ b/src/Misc.c @@ -155,3 +155,7 @@ void LiInitializeServerInformation(PSERVER_INFORMATION serverInfo) { uint64_t LiGetMillis(void) { return PltGetMillis(); } + +uint32_t LiGetHostFeatureFlags(void) { + return SunshineFeatureFlags; +}