Commit 49fad7ae authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: allow the user to sleep his/her Mac using the Apple Remote using the...

macosx: allow the user to sleep his/her Mac using the Apple Remote using the designated AR event (close #4383)

This code uses NSAppleScript. Hence, it is likely going to be incompatible with the current sandbox implementation.
(cherry picked from commit 9a73999a1f22b13051da16feaf54d8dd02e5bc80)
parent 041b88e4
......@@ -51,6 +51,8 @@ Mac OS X:
* Added media key support for keyboards by other manufacturers than Apple
This fix was facilitated through a hardware donation by ZF Friedrichshafen AG
manufacturing keyboards under the brand "Cherry".
* Added support for the Apple Remote to set the Mac to sleep using a longer
press on the Play/Pause button
* Improved compatibility with other 3rd party apps using SPMediaKeyTap
* Fullscreen fixes
* Keep Aspect Ratio when resizing is back
......
......@@ -1023,6 +1023,13 @@ static VLCMain *_o_sharedMainInstance = nil;
case kRemoteButtonMenu:
[o_controls showPosition: self]; //FIXME
break;
case kRemoteButtonPlay_Sleep:
{
NSAppleScript * script = [[NSAppleScript alloc] initWithSource:@"tell application \"System Events\" to sleep"];
[script executeAndReturnError:nil];
[script release];
break;
}
default:
/* Add here whatever you want other buttons to do */
break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment