mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2025-07-23 12:44:19 +00:00
Add support for the pause button
This commit is contained in:
parent
9e8903402b
commit
3178f87707
@ -26,6 +26,19 @@ static NSLock *controllerStreamLock;
|
|||||||
|
|
||||||
if (controller != NULL) {
|
if (controller != NULL) {
|
||||||
NSLog(@"Controller connected!");
|
NSLog(@"Controller connected!");
|
||||||
|
controller.controllerPausedHandler = ^(GCController *controller) {
|
||||||
|
// We call LiSendControllerEvent while holding a lock to prevent
|
||||||
|
// multiple simultaneous calls since this function isn't thread safe.
|
||||||
|
[controllerStreamLock lock];
|
||||||
|
LiSendControllerEvent(PLAY_FLAG, 0, 0, 0, 0, 0, 0);
|
||||||
|
|
||||||
|
// Pause for 100 ms
|
||||||
|
usleep(100 * 1000);
|
||||||
|
|
||||||
|
LiSendControllerEvent(0, 0, 0, 0, 0, 0, 0);
|
||||||
|
[controllerStreamLock unlock];
|
||||||
|
};
|
||||||
|
|
||||||
if (controller.extendedGamepad != NULL) {
|
if (controller.extendedGamepad != NULL) {
|
||||||
controller.extendedGamepad.valueChangedHandler = ^(GCExtendedGamepad *gamepad, GCControllerElement *element) {
|
controller.extendedGamepad.valueChangedHandler = ^(GCExtendedGamepad *gamepad, GCControllerElement *element) {
|
||||||
short buttonFlags;
|
short buttonFlags;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user