I know that it is possible to have KeyDown event in Objective-c but I don't know about that language but I would like to control my program with keyboard,which is in C and C++. I found some examples but all of them are for windows or java... I search xcode it seems that everything is about Objective-c and cocoa that I don't know about them, I just looking for simple example ...
Thanks in advance
I guess what you are looking for is Carbon Events Manager.
Have a look at this article to see an example of how to use it. You would have to install an event handler for { kEventClassKeyboard, kEventRawKeyDown }.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.