Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > (Cocoa) How do I respond to mouse and keyboard events in a straightforward manner?

(Cocoa) How do I respond to mouse and keyboard events in a straightforward manner?
Thread Tools
Forum Regular
Join Date: Jun 2007
Status: Offline
Reply With Quote
Mar 8, 2009, 11:51 AM
 
Hi All,

I've got a question similar to the post here: http://forums.macnn.com/79/developer...-once-and-all/

Basically, I'm looking for a way to handle mouse/keyboard events across the board. Say, for instance, I have a window with several controls (15-20). On this window, I also have an NSTextView in which I display information about the current control over which I'm hovering. Now, I surely don't want to create a delegate for each and every control in order to perform the desired action(s). So, how do I go about capturing the events in a "central" manner so that I can respond as desired based on the type of item over which I'm hovering?

Keep in mind that I've read the Apple docs regarding "Mouse-Tracking Events" (http://developer.apple.com/documenta...section_2.html). Not only is the solution less than desirable, but it doesn't guarantee that events will even fire in the proper order.

Admittedly, I've become spoiled with the ability in higher level languages (e.g. RealBasic) to directly access all events related to the mouse and keyboard in relation to most any control. If anyone has any suggestions, I'm all ears.

Best!
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 07:53 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2