mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2026-02-16 10:30:47 +00:00
Add button combination to quit streaming for gamepads
This commit is contained in:
@@ -91,6 +91,7 @@ static bool grabbingDevices;
|
||||
|
||||
#define QUIT_MODIFIERS (MODIFIER_SHIFT|MODIFIER_ALT|MODIFIER_CTRL)
|
||||
#define QUIT_KEY KEY_Q
|
||||
#define QUIT_BUTTONS (PLAY_FLAG|BACK_FLAG|LB_FLAG|RB_FLAG)
|
||||
|
||||
static bool (*handler) (struct input_event*, struct input_device*);
|
||||
|
||||
@@ -326,6 +327,9 @@ static bool evdev_handle_event(struct input_event *ev, struct input_device *dev)
|
||||
}
|
||||
}
|
||||
|
||||
if (gamepadModified && (dev->buttonFlags & QUIT_BUTTONS) == QUIT_BUTTONS)
|
||||
return false;
|
||||
|
||||
dev->gamepadModified |= gamepadModified;
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user