I want to execute the hot key operation to APP.For example the photo booth app may use the command+option+ EnterKey to complete take a picture. My code is as follows:
AXUIElementRef app=[self processIdentifierOfAppName:@"Photo Booth"];
//Method one:
AXUIElementPostKeyboardEvent(app,0,cmdKey,YES);
AXUIElementPostKeyboardEvent(app,0,optionKey,YES);
AXUIElementPostKeyboardEvent(app,0,kEnterCharCode,YES);
AXUIElementPostKeyboardEvent(app,0,cmdKey,NO);
AXUIElementPostKeyboardEvent(app,0,optionKey,NO);
AXUIElementPostKeyboardEvent(app,0,kEnterCharCode,NO);
//Method two:
AXUIElementPostKeyboardEvent(app,0,cmdKey&optionKey&kEnterCharCode,YES);
But is unable to complete this function. How can achieve this effect?