mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-17 14:11:33 +00:00
Add extended button support with Sunshine
This commit is contained in:
@@ -27,7 +27,10 @@ const int SdlInputHandler::k_ButtonMap[] = {
|
|||||||
BACK_FLAG, SPECIAL_FLAG, PLAY_FLAG,
|
BACK_FLAG, SPECIAL_FLAG, PLAY_FLAG,
|
||||||
LS_CLK_FLAG, RS_CLK_FLAG,
|
LS_CLK_FLAG, RS_CLK_FLAG,
|
||||||
LB_FLAG, RB_FLAG,
|
LB_FLAG, RB_FLAG,
|
||||||
UP_FLAG, DOWN_FLAG, LEFT_FLAG, RIGHT_FLAG
|
UP_FLAG, DOWN_FLAG, LEFT_FLAG, RIGHT_FLAG,
|
||||||
|
MISC_FLAG,
|
||||||
|
PADDLE1_FLAG, PADDLE2_FLAG, PADDLE3_FLAG, PADDLE4_FLAG,
|
||||||
|
TOUCHPAD_FLAG,
|
||||||
};
|
};
|
||||||
|
|
||||||
GamepadState*
|
GamepadState*
|
||||||
@@ -162,6 +165,13 @@ void SdlInputHandler::handleControllerAxisEvent(SDL_ControllerAxisEvent* event)
|
|||||||
|
|
||||||
void SdlInputHandler::handleControllerButtonEvent(SDL_ControllerButtonEvent* event)
|
void SdlInputHandler::handleControllerButtonEvent(SDL_ControllerButtonEvent* event)
|
||||||
{
|
{
|
||||||
|
if (event->button >= SDL_arraysize(k_ButtonMap)) {
|
||||||
|
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
|
"No mapping for gamepad button: %u",
|
||||||
|
event->button);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
GamepadState* state = findStateForGamepad(event->which);
|
GamepadState* state = findStateForGamepad(event->which);
|
||||||
if (state == NULL) {
|
if (state == NULL) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ struct GamepadState {
|
|||||||
SDL_TimerID mouseEmulationTimer;
|
SDL_TimerID mouseEmulationTimer;
|
||||||
uint32_t lastStartDownTime;
|
uint32_t lastStartDownTime;
|
||||||
|
|
||||||
short buttons;
|
int buttons;
|
||||||
short lsX, lsY;
|
short lsX, lsY;
|
||||||
short rsX, rsY;
|
short rsX, rsY;
|
||||||
unsigned char lt, rt;
|
unsigned char lt, rt;
|
||||||
|
|||||||
Submodule moonlight-common-c/moonlight-common-c updated: c9426a6a71...9bf09d681e
Reference in New Issue
Block a user