• 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: Ryan Britton <email@hidden>
  • Date: Thu, 1 Jun 2006 20:49:43 -0700

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


  • Follow-Ups:
    • Re: recieving mouseMoved: events when inactive
      • From: "Adam Johnson" <email@hidden>
References: 
 >recieving mouseMoved: events when inactive (From: "Adam Johnson" <email@hidden>)

  • Prev by Date: signgam symbol missing from i386 (Intel) math.h
  • Next by Date: Re: signgam symbol missing from i386 (Intel) math.h
  • Previous by thread: recieving mouseMoved: events when inactive
  • Next by thread: Re: recieving mouseMoved: events when inactive
  • Index(es):
    • Date
    • Thread