Commit 9a73999a 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.
parent 8548e873
...@@ -1029,6 +1029,13 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -1029,6 +1029,13 @@ static VLCMain *_o_sharedMainInstance = nil;
case kRemoteButtonMenu: case kRemoteButtonMenu:
[o_controls showPosition: self]; //FIXME [o_controls showPosition: self]; //FIXME
break; break;
case kRemoteButtonPlay_Sleep:
{
NSAppleScript * script = [[NSAppleScript alloc] initWithSource:@"tell application \"System Events\" to sleep"];
[script executeAndReturnError:nil];
[script release];
break;
}
default: default:
/* Add here whatever you want other buttons to do */ /* Add here whatever you want other buttons to do */
break; 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