Command line tool (PDF Workflow) in OSX that detects if key is down

Posted by kroko on Stack Overflow See other posts from Stack Overflow or by kroko
Published on 2010-03-29T15:08:56Z Indexed on 2010/03/29 15:13 UTC
Read the original article Hit count: 203

Filed under:
|
|
|

Hello!

I'm writing a OSX PDF Workflow in ObjC and C. A single executable ("UNIX Tool" as named in the Apple reference), that reads in the spooled PDF file, does some parsing.

I'd like to give more functionality by enabling a key-down event handling, meaning
- when user opens print dialog in an application
- and chooses to left-mouse-click on the custom made pdf workflow to run it
- depending on if a keyboard key is down (i.e. option key, but "any key down" would be enough for me) when running that workflow
- a decision is made in the code.

I have read NSEvent and Carbon Event Manager reference and it seems that in this case (a plain unix executable + not run as root) it's not possible. Or is it? Many thanks in advance, Kroko

© Stack Overflow or respective owner

Related posts about osx

Related posts about objective-c