mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2025-07-03 16:25:31 +00:00
Merge remote-tracking branch 'hhromic/code-cleanup'
This commit is contained in:
commit
497cb87ea5
@ -93,7 +93,7 @@ static bool grabbingDevices;
|
||||
|
||||
int evdev_gamepads = 0;
|
||||
|
||||
#define QUIT_MODIFIERS (MODIFIER_SHIFT|MODIFIER_ALT|MODIFIER_CTRL)
|
||||
#define ACTION_MODIFIERS (MODIFIER_SHIFT|MODIFIER_ALT|MODIFIER_CTRL)
|
||||
#define QUIT_KEY KEY_Q
|
||||
#define QUIT_BUTTONS (PLAY_FLAG|BACK_FLAG|LB_FLAG|RB_FLAG)
|
||||
|
||||
@ -224,7 +224,7 @@ static bool evdev_handle_event(struct input_event *ev, struct input_device *dev)
|
||||
}
|
||||
|
||||
// Quit the stream if all the required quit keys are down
|
||||
if ((dev->modifiers & QUIT_MODIFIERS) == QUIT_MODIFIERS &&
|
||||
if ((dev->modifiers & ACTION_MODIFIERS) == ACTION_MODIFIERS &&
|
||||
ev->code == QUIT_KEY && ev->value != 0) {
|
||||
return false;
|
||||
}
|
||||
|
@ -31,7 +31,8 @@
|
||||
#include <stdlib.h>
|
||||
#include <poll.h>
|
||||
|
||||
#define MODIFIERS (MODIFIER_SHIFT|MODIFIER_ALT|MODIFIER_CTRL)
|
||||
#define ACTION_MODIFIERS (MODIFIER_SHIFT|MODIFIER_ALT|MODIFIER_CTRL)
|
||||
#define QUIT_KEY 0x18 /* KEY_Q */
|
||||
|
||||
static Display *display;
|
||||
static Window window;
|
||||
@ -56,8 +57,8 @@ static int x11_handler(int fd) {
|
||||
case KeyPress:
|
||||
case KeyRelease:
|
||||
if (event.xkey.keycode >= 8 && event.xkey.keycode < (sizeof(keyCodes)/sizeof(keyCodes[0]) + 8)) {
|
||||
if ((keyboard_modifiers & MODIFIERS) == MODIFIERS && event.type == KeyRelease) {
|
||||
if (event.xkey.keycode == 0x18)
|
||||
if ((keyboard_modifiers & ACTION_MODIFIERS) == ACTION_MODIFIERS && event.type == KeyRelease) {
|
||||
if (event.xkey.keycode == QUIT_KEY)
|
||||
return LOOP_RETURN;
|
||||
else {
|
||||
grabbed = !grabbed;
|
||||
|
Loading…
x
Reference in New Issue
Block a user