plugins-workspace icon indicating copy to clipboard operation
plugins-workspace copied to clipboard

how to listen the change event of clipboard?

Open xdewx opened this issue 8 months ago • 2 comments

I noticed that clipboard-manager just supports read & write, but how to listen change event?

xdewx avatar Mar 31 '25 06:03 xdewx

the official plugin does not have this functionality yet (mainly because there's no OS api for that afaik) but there's a community plugin https://github.com/CrossCopy/tauri-plugin-clipboard which uses https://github.com/ChurchTao/clipboard-rs to also have an event handler (iirc it works by constantly checking the clipboard content itself)

FabianLars avatar Mar 31 '25 16:03 FabianLars

the official plugin does not have this functionality yet (mainly because there's no OS api for that afaik) but there's a community plugin https://github.com/CrossCopy/tauri-plugin-clipboard which uses https://github.com/ChurchTao/clipboard-rs to also have an event handler (iirc it works by constantly checking the clipboard content itself)

Polling can indeed achieve the goal, but the efficiency would be lower. As far as I know, the WinAPI can support monitoring clipboard events on Windows, but it's unclear for other platforms. It would be better the official team can provide a unified interface.

xdewx avatar Mar 31 '25 17:03 xdewx