• 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: receiving mouse events outside of my window
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: receiving mouse events outside of my window


  • Subject: Re: receiving mouse events outside of my window
  • From: email@hidden
  • Date: Sat, 25 May 2002 09:05:02 -0500

It does, but I need to be able to close the window if the user clicks outside of it. You said that a modal panel still would not receive events outside of my window, right? This has to be possible. Other menus do it all the time. How do they do it?

On Friday, May 24, 2002, at 11:38 PM, Anthony Arthur wrote:

hmm, maybe what you really want here is a modal panel. This channels all events directly to that panel, no matter how many other apps are running in the background. The window still must receive all clicks within its bounds, but no other window will respond until that panel has been closed.

make sense?

-b

On Friday, May 24, 2002, at 04:56 PM, email@hidden wrote:

Well, here is what I am trying to do:
It is a long explanation, but I think it will be better than explaining it all piecemeal later. I am writing a custom view to use in an NSStatusItem (using -setView) and I want it to mimic the behavoir of the volume menu item that apple includes with OS X. To aid in this I also subclass the NSSlider so that I can deal with mouse events in a special way. When the user clicks on the status item, my custom view tracks the mouse until either a mouse up occurs or the mouse enters the knob rect. If the mouse up occurs before any movement has happened, then the event loop waits until a mouse down event occurs. Here is the problem: if the mouseDown occurs inside the knob rect, then I pass the event to my custom Slider class and it is dealt with. However if the click occurs outside of the knob rect(even outside of the window containing the slider), I want the window containing the slider to close and the loop to exit. I have tried getting events directly from the application, but it seems that my app doesn't know about events unless they happen inside one of it's windows.

On Friday, May 24, 2002, at 11:00 AM, Anthony Arthur wrote:

Ok, well if Thomas is just tracking the mouse that's one thing, but if he wants multiple applications to respond to the same mouse clicks that's another. Perhaps there's something Thomas is doing that makes this seem more sensible, but I'm would not be persuaded easily. Meanwhile, I'm really not interested in turning this into a religious type debate.

-b

On Friday, May 24, 2002, at 11:13 AM, David Remahl wrote:

While I agree in principle with what you are saying, I think you are being
too narrow-minded. You don't know what the person who asked the question is
trying to do. Maybe he/she is just trying to record the path that the mouse
pointer travells, even when his/her app is in the background, or some other
legitimate application. I have seen no indication, not in the original
question or in Rick's answer, that any passing of events is going to happen.

They are just talking about how to know when/where the mouse has moved, when
the application is in the background or the mouse is outside of any window
owned by the application.

Breaking the paradigm is sometimes the best, or only, think to do.

/ Rgds, David

Passing mouse events, or any event for that matter, between completely
separate applications, while it may be possible to do, is definitely NOT
the right thing to do. Just because it is possible to do something,
does not necessarily mean it is the correct way. Mouse events and
keyboard events belong to the key application, otherwise the window
server would pass every event to every running application. To do
otherwise breaks the paradigm.

I would suggest using distributed object, NSProxy & NSConnection.

-b

On Friday, May 24, 2002, at 10:26 AM, rsharp wrote:

I can only provide comments about this from a Carbon perspective.

Receiving mouse events outside ones window is definitely something valid
to do. e.g. it's common to listen to mouse moved events outside the
window. This is typically accomplished by have a "mouse event handler"
at
the application level.

What type of mouse events are you interested in?

Rick Sharp
Instant Interactive(tm)

On Fri, 24 May 2002, Anthony Arthur wrote:

Not really..., think about it, if someone tapped you on the shoulder,
would you want to also feel it in your eyeball? Doesn't make much
sense
does it? You can achieve the same effect programmatically.

--Brian

On Friday, May 24, 2002, at 01:47 AM, email@hidden wrote:

Is it possible to receive mouse events that did not occur in the
window
that owns the run loop? Or even in a window in another application?
_______________________________________________
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.
_______________________________________________
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.

  • Prev by Date: Re: Syntax question
  • Next by Date: Subclassing NSDocumentController & Finder
  • Previous by thread: Re: receiving mouse events outside of my window
  • Next by thread: C++ Strings Handling
  • Index(es):
    • Date
    • Thread