• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Intel compatibility, please help
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Intel compatibility, please help
      • From: Andrew Farmer <email@hidden>
  • Prev by Date: Manipulating image meta data from Cocoa
  • Next by Date: Unit testing and Xcode integration
  • Previous by thread: Re: Manipulating image meta data from Cocoa
  • Next by thread: Re: Intel compatibility, please help
  • Index(es):
    • Date
    • Thread