Help with OS / OBJ-C integration, please.

Steven H.

Registered
Hi,

I'm a moderately well-versed programmer who is taking on Objective C to handle something that annoys me to no end about OSX: no quick way to get between applications.

I know what you're thinking, but what about Command-Tab. Let's admit it, this is no good when you have iTunes, * builder, x11 and 2 chat clients open. talk about inefficient!

I came from Linux land where my favorite WM was ion. It was a full-creen, anti-mouse window manager that had a really great idea in it: you hit an escape sequence (mappable as you see fit) and you are given a command line. You type the name of the appliation and can use TAB to complete the match once you have enough unique characters (a la bash).

Example: (escape sequence) [type]i c *tab* [autocomplete] iChat *enter*

And viola! In ichat. I would like to add the suffix of "/" so that I could do the preceeding, then hit 'foom<tab>' and then have iChat's chat box with 'fooman' get the focus.

Sound handy? I think so.

OK. so the question is:

How do I map a key sequence into the OS to automatically flip to an application? In my description above i describe the 'escape sequence' -- that's what I'm after how to program.

I gather that I need to override the keyDown method in my application and listen for my 'escape sequence' combo? does that sound right? I gleaned that from: file:///Developer/Documentation/Cocoa/TasksAndConcepts/ProgrammingTopics/BasicEventHandling/index.html

I've been looking all over the O'reilly OSX books for an example of how to do this, but no luck.

developer.apple.com didn't seem to have any examples either. could someone possibly help me on this one?

Thanks for helping get another OSX app-writer / lover off on the right foot.

Steven
 
Hmm...yes it would be a keydown event...but you would have to have your application active for it to work. Meaning the escape code wouldn't work in any application but yours.

Maybe if you made it a service, but I'm not 100% on that - I've never even looked at the service stuff at all.
 
My plan was to put this application I'm proposing into the Login Items folder so that it would launch on startup of the OS (similar to other service / daemon - like application that I run: e.g. codetek's virtual desktop pager).

Once that was running, then the 'escape sequence' could be issued and the user would be flipped back to my running application. The application, in all liklihood, would consist of a simple text box (floating above the dock as i see it) where you typed, tabbed, and returned.

thanks for your input though.
 
I think there is an application wich does that already: you type some combo keys and then you start to type the name of the application/document/folder and it autocompletes it and opens it when you press return. I don't remember the name, but you may want to do a search in versiontracker.com
 
Back
Top