Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!elroy.jpl.nasa.gov!decwrl!adobe!heaven!glenn From: glenn@heaven.woodside.ca.us (Glenn Reid) Newsgroups: comp.sys.next Subject: window focus revisited Message-ID: <339@heaven.woodside.ca.us> Date: 3 Dec 90 05:12:35 GMT Reply-To: glenn@heaven.woodside.ca.us (Glenn C. Reid) Organization: RightBrain Software, Woodside, CA Lines: 43 Just when we thought the discussion about click-to-type versus mouse focus had died down, now this, hot off the wire. The new Terminal application in 2.0 has a very mysterious entry in its Shell menu called "Steal Keys". Unfortunately Terminal has no Help in its menus, so I had to go digging to figure out what this did, but I found it, thanks to Digital Librarian. The "Steal Keys" option in Terminal makes it possible to focus the Terminal application simply by moving the mouse into its window (no click is required). It is purportedly for debugging, as in this passage from the documentation, but it is interesting in light of our discussion about this topic. I'm not sure how it's done, but it appears that Terminal simply does not become the key window, but does "steal" keydown events from the event queue somehow. The previously-active application is still highlighted and looks active. Here's the passage from the docs: The Steal Keys command is useful when you're running the GNU debugger. The purpose of this command is to allow you to effectively debug an application from a shell window in which the debugger is running. The debugging process inevitably involves alternately activating Terminal (to type debugger commands) and the other application (to test the application being debugged). However, clicking to alternatively activate and deactivate the application being debugged causes the application to change its state in unpredictable ways. To let you get around this problem, the Steal Keys command puts Terminal in a special debugging mode. In this mode, Terminal can be activated or deactivated simply by moving the cursor into or out of the Terminal shell window. Therefore, you can easily activate Terminal whenever you want to type a debugger command, without clicking and thus affecting the state of the application you're debugging. When you're ready to exit debugging mode, click in the Terminal window to make the Terminal main menu reappear, and then choose this command again (its name will have changed to Yield Keys). I'd be curious to know just how this is done, and whether or not it is considered a hack that you and I should not do in our applicatons :-) Hey, Scott, have anything to toss in about this feature? Glenn