views:

39

answers:

2

I currently have a program written in Cocoa and I would like it to have an onscreen keyboard as I am thinking of using a touch-screen monitor and would like to not have a keyboard for this particular piece of software.

I know there is an onscreen keyboard in Cocoa-touch, but as far as I am aware, that can only be used on the iPhone, iTouch and iPad.

Is there anyway I can use it in a regular Cocoa application?

Thanks

+1  A: 

Unfortunately, the on-screen keyboard is part of UIKit, which is only available on iOS. The only (hacky) option that I'm aware of would be to run your app in the iPad simulator. Not ideal, for sure and I'm not sure how the simulator handles a multi-touch capable display.

Barry Wark
Ok, thanks for your answer, I thought that might be the case.Guess I'm making an onscreen keyboard myself from scratch then!
DanieL
+2  A: 

UIKit isn't part of Mac OS X, unfortunately, so you can't use anything from it. There is an onscreen keyboard that you can enable in the system's Language & Text preference pane, but I don't know how you'd do it programmatically. If this is a major requirement for your system, though, it would probably be better to roll your own. OS X is not really designed for touchscreens and has just recently gotten the most rudimentary support for touch-y interaction (thanks to the Magic Mouse and the MacBooks' trackpad).

Chuck