From an Electron application, is it possible to output text to wherever the cursor is currently located at, i.e. even if that is somewhere outside of the actual Electron app?
So far the best solution I've come up with is to write the text on to the clipboard, and notify the user that the text is ready to be pasted. I'd like to get rid of that extra step.
I would give RobotJS a try. It appears to do what you need.
You may try an alternative to RobotJS. It is a very small and still cross platform library to send keys to your operational system called node-key-sender.
Install it with npm install --save-dev node-key-sender.
And send a text to the keyboard using:
var ks = require('node-key-sender');
ks.sendText('This is my text');
Check out the documentation page: https://www.npmjs.com/package/node-key-sender.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With