Intel compatibility, please help
Intel compatibility, please help
- Subject: Intel compatibility, please help
- From: Fabian <email@hidden>
- Date: Sun, 13 Aug 2006 17:11:57 +0200
Hello!
my app is launched with a global hotkey, using a snippet of code that
I found on the web (can't remember who to credit, sorry). It works
great on PPC but apparently not on Intel Macs. Can someone help me
spot the problem? I don't know too much about cocoa (the actual app
is built in ASS).Thank you very much in advance.
Regards,
Fabian
#import <Cocoa/Cocoa.h>
#import <Carbon/Carbon.h>
#import <Foundation/Foundation.h>
#import "Hotkey.h"
const UInt32 kLockUIElementHotKeyIdentifier = 'lUIk';
const UInt32 kLockUIElementHotKey = 36;
EventHotKeyRef gMyHotKeyRef;
EventHotKeyID gMyHotKeyID;
EventHandlerUPP gAppHotKeyFunction;
pascal OSStatus LockUIElementHotKeyHandler(EventHandlerCallRef
nextHandler,EventRef theEvent, void *userData);
@implementation Hotkey
- (void)awakeFromNib
{
EventTypeSpec eventType;
gAppHotKeyFunction = NewEventHandlerUPP(LockUIElementHotKeyHandler);
eventType.eventClass = kEventClassKeyboard;
eventType.eventKind = kEventHotKeyPressed;
InstallApplicationEventHandler(gAppHotKeyFunction,
1,&eventType,NULL,NULL);
gMyHotKeyID.signature = kLockUIElementHotKeyIdentifier;
gMyHotKeyID.id = 1;
UInt32 modifiers;
modifiers = cmdKey;
modifiers |= optionKey;
RegisterEventHotKey(kLockUIElementHotKey, modifiers, gMyHotKeyID,
GetApplicationEventTarget(), 0, &gMyHotKeyRef);
}
@end
pascal OSStatus LockUIElementHotKeyHandler(EventHandlerCallRef
nextHandler,EventRef theEvent, void *userData)
{
NSLog(@"Hotkey pressed"); // We don't get this far...
return noErr;
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden