0

So I have a Touch Bar application, with each button already corresponding to an IBAction. What I want is when a button is clicked, the letter "a" is typed, but on, lets say, like a google doc.

So if I am on a google doc, and my application is running, and I press the "a" button, I want the letter "a" to appear on the google doc. I don't know how to even approach this. Is there a library specially made for this? Thanks.

Jerry Qian
  • 33
  • 1
  • 8
  • Do you mean [Programmatically enter text into any application](https://stackoverflow.com/questions/25858495/programmatically-enter-text-into-any-application)? – Willeke Jun 03 '19 at 00:05
  • Yes. Sorry for the late response. But I don't know any objective-c. I need a swift only way to do this. – Jerry Qian Jun 03 '19 at 11:28
  • See [Swift: forward keystrokes to a different process](https://stackoverflow.com/questions/47560084/swift-forward-keystrokes-to-a-different-process?rq=1) or [Simulate keypress using Swift](https://stackoverflow.com/questions/27484330/simulate-keypress-using-swift/27487493#27487493) or [Send KeyEvent to a Target window via process Id](https://stackoverflow.com/questions/47116132/send-keyevent-to-a-target-window-via-process-id?noredirect=1&lq=1) or use Google. – Willeke Jun 03 '19 at 20:37

0 Answers0