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
...@@ -960,16 +960,16 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -960,16 +960,16 @@ static VLCMain *_o_sharedMainInstance = nil;
{ {
case kRemoteButtonRight_Hold: case kRemoteButtonRight_Hold:
[[VLCCoreInteraction sharedInstance] forward]; [[VLCCoreInteraction sharedInstance] forward];
break; break;
case kRemoteButtonLeft_Hold: case kRemoteButtonLeft_Hold:
[[VLCCoreInteraction sharedInstance] backward]; [[VLCCoreInteraction sharedInstance] backward];
break; break;
case kRemoteButtonVolume_Plus_Hold: case kRemoteButtonVolume_Plus_Hold:
[[VLCCoreInteraction sharedInstance] volumeUp]; [[VLCCoreInteraction sharedInstance] volumeUp];
break; break;
case kRemoteButtonVolume_Minus_Hold: case kRemoteButtonVolume_Minus_Hold:
[[VLCCoreInteraction sharedInstance] volumeDown]; [[VLCCoreInteraction sharedInstance] volumeDown];
break; break;
} }
if(b_remote_button_hold) if(b_remote_button_hold)
{ {
...@@ -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