Sending key stroke to front application in Cocoa?
I was wondering would this be hard to do; I have a barcode reader for my isight (mac webcam) (evoBarcode). At the moment, the program reads the barcode fine and adds it to a text field at the side of the application. Event when in the background, the application continues to run and read barcodes which is fine.
开发者_开发技巧I was wondering, is it easy to send the result from this (I have already located the exact variable where the barcode is caught) to the front application as a keystroke? (the front application being textEdit or something.
I've tried searching around for a bit and found CGRemoteOperation, but havn't found a great lot of resources or examples on it.
Any ideas?
Thanks.
Depending on the reader behaviour another option could be to implement a service menu item. That way you don't mess with the clipboard.
精彩评论