Clipboard change event for Node.js/Electron.js/NW.js
Note:
- It's not being polled
- This implementation is based on child_process. A native node module using N-API is being developed.
Usage
import clipboardListener from 'clipboard-event'
// To start listening
clipboardListener.startListening();
clipboardListener.on('change', () => {
console.log('Clipboard changed');
});
// To stop listening
clipboardListener.stopListening();
Motivation
- electron/electron#2280
- https://github.com/DoumanAsh/clipboard-master
- aweinstock314/rust-clipboard#48
Credits
- Linux- https://stackoverflow.com/a/44992967
- Windows- https://gist.github.com/glombard/7986317 & https://stackoverflow.com/questions/17762037/error-while-trying-to-copy-string-to-clipboard
- MAC- http://www.alecjacobson.com/weblog/?p=2376 & https://gist.github.com/Daemon-Devarshi/13efd24f027a775ee862 & https://developer.apple.com/documentation/appkit/nspasteboard?language=occ