I am new to Electron framework, I wanna know does it have access to native resources like - Clipboard - Keypress (not on my web page, globally. Like a keyboard hook on windows)
I believe what you are looking for is in the clipboard API.
There is also a global shortcut API. Check out this SO answer where I gave an example of how it works.
Here is an example of some basic read/write operations using the clipboard API:
const {clipboard} = require('electron');
clipboard.writeText('Example String');
let clipboardStr = clipboard.readText();
The 'Example String' is the text you would add to the clipboard.
const {clipboard} = require('electron')
clipboard.writeText('Example String', 'selection')
console.log(clipboard.readText('selection'))
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