in fact i am building a virtual keyboard how can i send a keyboard event to the program through pressing a button? thanks
+7
A:
You could use Quartz Event Servcices.
They provide CGEventCreateKeyboardEvent
which allows you to emulate any physical key-press.
The API is modeled after real key events.
So you have to call "Shift" + "Character" to get an upper case letter. You also need to release keys you have pressed.
Apple's documentation contains sample code.
Update:
We are talking about Mac OS X, right? Please add some tags to your original question.
weichsel
2009-12-21 08:30:46
A:
yes we are talking about Mac OS X for sure. thanks for your reply i will work on it. many thanks
tempo
2010-01-26 16:06:50
Please give the responder a green check mark for his excellent answer.
Kevin Conner
2010-01-27 02:43:30