Clipboard monitoring on Mac OS X | Java

前端 未结 2 1475
猫巷女王i
猫巷女王i 2021-01-02 05:56

I\'m having troubles getting data from the system clipboard on Mac OS X. What I\'m trying to do is to listen to the system clipboard and print the content of the clipboard e

相关标签:
2条回答
  • 2021-01-02 06:35

    It seems that there is no elegant way around this problem, NSPasteboard does not provide clipboard ownership concept. You can't even solve this problem writing native Objective C.

    The only solution is to periodically sample the clipboard.

    0 讨论(0)
  • 2021-01-02 06:49

    This seems to be an open bug, see MACOSX_PORT-511 ClipboardOwner method lostClipboard is not called if app is not focused.

    0 讨论(0)
提交回复
热议问题