• 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: howto get global mouse states
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: howto get global mouse states


  • Subject: Re: howto get global mouse states
  • From: "Sean McBride" <email@hidden>
  • Date: Mon, 4 Oct 2004 12:58:03 -0400

Christian Robl (email@hidden) on Mon, Oct 4, 2004 06:34 said:

>I want to build a COCOA application wich should recenter its window on the
>current mouseposition if a particular mouse button is pressed (e.g. middle
>button).

First, I have to say that's a pretty weird thing to do, but I'll give you
the benefit of the doubt that you know what you're doing. :)

>In "awakefromnib" I call [NSEvent mouseLocation] for an initial window
>placement which works great. While running the app I can get some
>informations via polling [NSApp currentEvent] and
>processign according the Event occured, but as soon as I mov/click outside
>of the app's window
>no event occurs or is processed by my app.
>
>Whats wrong?

I guess that's by design. If a click does not touch any interface
element of your application, then the OS sends the event elsewhere
(perhaps to another app's window that is underneath where you clicked).

>How can I get mouse states regardless if the apps window is
>clicked/active.

I don't know. Perhaps you could make a big invisible window that covers
the screen(s) and is below all your other windows. Then, presumably,
that window would get events. I've never tried though.



_______________________________________________
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: howto get global mouse states
      • From: Henry McGilton <email@hidden>
  • Prev by Date: Re: Can NSImageView not antialias a bitmap image?
  • Next by Date: make a player with "output to portable mp3 audio player" support
  • Previous by thread: howto get global mouse states
  • Next by thread: Re: howto get global mouse states
  • Index(es):
    • Date
    • Thread