mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2025-07-01 15:26:09 +00:00
Add extended button support with Sunshine
This commit is contained in:
parent
68daa90b7e
commit
e42de9d155
@ -27,7 +27,10 @@ const int SdlInputHandler::k_ButtonMap[] = {
|
||||
BACK_FLAG, SPECIAL_FLAG, PLAY_FLAG,
|
||||
LS_CLK_FLAG, RS_CLK_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*
|
||||
@ -162,6 +165,13 @@ void SdlInputHandler::handleControllerAxisEvent(SDL_ControllerAxisEvent* 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);
|
||||
if (state == NULL) {
|
||||
return;
|
||||
|
@ -19,7 +19,7 @@ struct GamepadState {
|
||||
SDL_TimerID mouseEmulationTimer;
|
||||
uint32_t lastStartDownTime;
|
||||
|
||||
short buttons;
|
||||
int buttons;
|
||||
short lsX, lsY;
|
||||
short rsX, rsY;
|
||||
unsigned char lt, rt;
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit c9426a6a71c4162e65dde8c0c71a25f1dbca46ba
|
||||
Subproject commit 9bf09d681ef21e5a1284b50a850fe4e5df3afbe3
|
Loading…
x
Reference in New Issue
Block a user