• 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: How does Pixie get the mouse position?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How does Pixie get the mouse position?


  • Subject: Re: How does Pixie get the mouse position?
  • From: John MacDonnell <email@hidden>
  • Date: Wed, 9 Jun 2004 09:08:07 +0200

On 9 Jun 2004, at 12:53 AM, Allan Odgaard wrote:

On 8. Jun 2004, at 22:32, John MacDonnell wrote:

I know I can set a Timer and get the [NSEvent mouseLocation]; but at school someone taught me that polling must be avoided as often as possible!

It certainly must, but I am afraid that in this case Apple leave you no alternative :( Please do file a bug/enhancement report -- this question has been raised a dozen times, and I can think of some very useful applications of being able to intercept the mouse, but polling would be very bad as it would probably drain the battery on portables... not to mention that for one application I have in mind, polling would simply not work, since I need *every* single mouse moved event.

well I did try to set a timer which fires every 0.1 and the CPU of my app shown by top is still it 0% so not bad... but still it a solution which sucks and I don't like.

There must be a way to get mouse interrupts without messing with the IOKit

I think about the Apple application called Pixie, it gets the mouse cursor position as I want,

Pixie has _CGSCurrentInputPointerPosition as external symbol, which would hint polling, and the UIElementExpector example from Apple also sets up a timer and calls GetMouse() 10 times pr. second.

sad that Apple found this solution as well...

That said, I do not know much about Carbon events. When registering for keys with application as target, they arrive even when the app is inactive. But I do not know if the same holds for mouse events.

Yeah I thought the same, but it seems there are no functions to register for mouse event as there are functions to register for hot keys....

thanks for your help!
John
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: How does Pixie get the mouse position?
      • From: Kyle Moffett <email@hidden>
References: 
 >How does Pixie get the mouse position? (From: John MacDonnell <email@hidden>)
 >Re: How does Pixie get the mouse position? (From: Allan Odgaard <email@hidden>)

  • Prev by Date: Re: Word count
  • Next by Date: Re: Word count
  • Previous by thread: Re: How does Pixie get the mouse position?
  • Next by thread: Re: How does Pixie get the mouse position?
  • Index(es):
    • Date
    • Thread