• 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
Re: recieving mouseMoved: events when inactive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: recieving mouseMoved: events when inactive


  • Subject: Re: recieving mouseMoved: events when inactive
  • From: "Adam Johnson" <email@hidden>
  • Date: Mon, 5 Jun 2006 21:51:53 -0400

Thank you.  That works great.

On 6/1/06, Ryan Britton <email@hidden> wrote:


How can I get mouseMoved: events when my application is inactive?


Carbon. Depending on your needs, you may also want to add an event handler to the application event target or the window event target.

EventHandlerRef trackMouseGlobal;

OSStatus mouseActivated(EventHandlerCallRef nextHandler,
EventRef theEvent, void *userData)
{
 [yourController mouseMoved];
 return CallNextEventHandler(nextHandler, theEvent);
}

- (void)applicationDidFinishLaunching:(NSNotification
*)aNotification
{
 //Add in a global handler
 EventTypeSpec globalEventType[2];
 globalEventType[0].eventClass = kEventClassMouse;
 globalEventType[0].eventKind = kEventMouseMoved;
 globalEventType[1].eventClass = kEventClassMouse;
 globalEventType[1].eventKind = kEventMouseDragged;


EventHandlerUPP globalHandlerFunction = NewEventHandlerUPP(mouseActivated); OSStatus result = InstallEventHandler(GetEventMonitorTarget(), globalHandlerFunction, 2, globalEventType, NULL, &trackMouseGlobal); }

- (void)applicationWillTerminate:(NSNotification
*)aNotification
{
 RemoveEventHandler(trackMouseGlobal);
}


_______________________________________________
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


References: 
 >recieving mouseMoved: events when inactive (From: "Adam Johnson" <email@hidden>)
 >Re: recieving mouseMoved: events when inactive (From: Ryan Britton <email@hidden>)

  • Prev by Date: NSMovieView & Apple's Protected Video
  • Next by Date: multiple document windows
  • Previous by thread: Re: recieving mouseMoved: events when inactive
  • Next by thread: signgam symbol missing from i386 (Intel) math.h
  • Index(es):
    • Date
    • Thread