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 > keyboard input to background app

keyboard input to background app
Thread Tools
Junior Member
Join Date: Apr 2001
Location: Seattle, WA, USA
Status: Offline
Reply With Quote
Apr 30, 2001, 04:45 PM
 

Does anyone know if it is possible to send keyboard input to an application that is not in the current responder chain?

I am implementing spring loaded folders in my finder replacement, and would like to get the space bar presses sent to my app whenever any other app is dragging over me. At present, I have it working after a delay by using the validateDrop messages in my tableView delegate, but I would like to support the classic finder style keyboard actions.

I've tried sending [[self window] makeKeyWindow] on my draggingEntered method, but that doesn't seem to work, I call [[self window] isKeyWindow] immediately after, and it returns NO.

     
Dedicated MacNNer
Join Date: Jan 2001
Location: Virginia, US
Status: Offline
Reply With Quote
May 5, 2001, 03:12 AM
 
Only the active application gets key events posted to it. If you want, you can force your application to the front via [[NSApplication sharedApplication] activateIgnoringOtherApps:YES]. [[NSApplication sharedApplication] isActive] tells you whether you're currently the active application or not.

Other than that, there's no way to get the keystrokes from Cocoa. Maybe there's something in the lower-level APIs, but I don't know. The HID stuff in the IOKit may be one place to look, but I think Apple is still working on those APIs.
     
   
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 09:40 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