58 if ( [container instantiateAndAddRemoteControlDeviceWithClass: [
AppleRemote class]] != 0 ) {
60 NSLog(
@"[container instantiateAndAddRemoteControlDeviceWithClass: [AppleRemote class]] successful");
63 NSLog(
@"[container instantiateAndAddRemoteControlDeviceWithClass: [AppleRemote class]] failed");
67 if ( [container instantiateAndAddRemoteControlDeviceWithClass: [
GlobalKeyboardDevice class]] != 0 ) {
69 NSLog(
@"[container instantiateAndAddRemoteControlDeviceWithClass: [GlobalKeyboardDevice class]] successful");
72 NSLog(
@"[container instantiateAndAddRemoteControlDeviceWithClass: [GlobalKeyboardDevice class]] failed");
76 [
self setValue: container forKey: @"remoteControl"];
78 NSLog(
@"AppleRemoteMainController init done");
82 NSLog(
@"AppleRemoteMainController init failed");
86- (void) postTheEvent: (
short int)buttonIdentifier modifierFlags:(
int)modifierFlags
91 [NSEvent otherEventWithType:NSApplicationDefined
93 modifierFlags:modifierFlags
95 windowNumber:[[NSApp keyWindow] windowNumber]
97 subtype:AppleRemoteControlEvent
98 data1: buttonIdentifier
109 NSString* pressed =
@"";
110 NSString* buttonName = nil;
115 pressed =
@"(AppleRemoteMainController: button pressed)";
117 switch(buttonIdentifier)
133 default: NSLog(
@"AppleRemoteMainController: Unmapped event for button %d", buttonIdentifier);
break;
136 [
self postTheEvent:buttonIdentifier modifierFlags: 0 ];
141 pressed =
@"(AppleRemoteMainController: button released)";
147 NSString* clickCountString =
@"";
148 if (clickCount > 1) clickCountString = [NSString stringWithFormat: @"%d clicks", clickCount];
149 NSString* feedbackString = [NSString stringWithFormat:@"(Value:%4d) %@ %@ %@", buttonIdentifier, buttonName, pressed, clickCountString];
152 NSLog(
@"%@", feedbackString);
154 if (pressedDown == NO) printf(
"\n");
RemoteControlEventIdentifier
@ kRemoteControl_Switched
@ kRemoteButtonRight_Hold
@ kRemoteButtonMinus_Hold
FILE * init(int, char **)
MultiClickRemoteBehavior * remoteBehavior()
RemoteControl * remoteControl
MultiClickRemoteBehavior * remoteControlBehavior
A behavior that adds multiclick and hold events on top of a device.
void setDelegate:(id delegate)
const wchar_t *typedef BOOL
#define SAL_WNODEPRECATED_DECLARATIONS_POP
#define SAL_WNODEPRECATED_DECLARATIONS_PUSH