Re: Locking key window
Re: Locking key window
- Subject: Re: Locking key window
- From: Michael Babin <email@hidden>
- Date: Thu, 8 Mar 2007 09:16:58 -0600
On Mar 7, 2007, at 7:58 PM, Rick Hoge wrote:
The app runs fine at present, but I would like to find a way to
ensure that, while an experimental run is in progress, all keyboard
activity is processed by the window presented to the subject, even
if another window is clicked with the mouse. I had a vague feeling
that this might be achievable using either a run loop or one of the
firstResponder methods defined in NSResponder. However I have yet
to find a solution.
If anyone has any tips on how this might be achieved, it will
probably save some aggravation one day when someone clicks the
experimenter's window by mistake and later realizes that none of
the subject's responses were recorded!
The kiosk-mode suggestions made previously are probably your best
bet, but if you're looking to keep all keyboard activity in your app
focused on one window then you could look into subclassing NSWindow
and overriding canBecomeKeyWindow (and possibly canBecomeMainWindow)
to disallow switching focus to other windows in your application.
This wouldn't prevent switching to other apps and their windows,
however.
--
Michael Babin email@hidden
Order N Development, LLC http://www.orderndev.com/
Goldfish Aquarium for Mac: http://www.lifeglobe.com/product/index.php?
pltid=2&ref=OrderNDev
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden