Add button combination to quit streaming for gamepads

This commit is contained in:
Iwan Timmer
2017-06-11 18:32:46 +02:00
parent cbf31be73b
commit cdca4c1b3a
4 changed files with 10 additions and 2 deletions

View File

@@ -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;
}