I am playing with a small electron app to make a simple copy/paste method.
I have registered a hotkey using globalShortcut
:
globalShortcut.register(mod + '+' + key, () => {
clipboard.writeText(content);
// Paste content to any input field/app
});
Is it possible for to now go to notepad and press the registered modifier to paste the content?
Example: App loads, registers a shortcut which sets the clipboard with their desired text.
They then go to a form where they want to paste this content and hit their key which pastes it for them?
This is essentially a way for staff to set up common shortcut / snippets of text with whatever key combinations they want. So if they are filling out report 123, they can just hit their key "Ctrl + Shift + R" which pastes the content they have associated with that hotkey.
How can I do this or simulate a Ctrl V to trigger it?
I have tried both RobotJS (doesn't support global shortcuts) and a Java version (preferred to not use anyway).