Skip navigation.
 
mlRe: monitor the clipboard?
FROM : Stefan van den Oord
DATE : Sun Dec 19 10:01:20 2004

Hi Jim,

I've been looking into this subject myself. After some research, the
only thing I could come up with was the message 'changeCount' you can
send to pasteboards. Indeed: polling. IIRC, I read somewhere that
there used to be a notification from the pasteboard you could use for
that, but that has been removed (performance impact?).

Anyway, I don't think that polling should be too much a problem. I
polled every .5 seconds. It was enough for my application and it
didn't have a noticeable impact on my (400MHz) system.

HTH,

Stefan


On Sat, 11 Dec 2004 15:00:43 -0600, Jim Thomason <<email_removed>> wrote:
> Is there a good way to monitor the clipboard from a background
> application? I'd just like to keep track of when the general
> pasteboard is changed.
>
> I've come up with a couple of ideas, which I don't really like.
>
> 1) have the app looping and constantly polling the clipboard to see if
> its changed. This would consume CPU. Probably not a lot, but I'd like
> as little as possible.
> 2) insert a global hotkey to intercept copy and paste and stick it on
> the clipboard myself. This seems like I'd be asking for trouble.
>
> Ideally, I'd like the equivalent of the Pasteboard pasting a
> "NSPasteBoardDidChange" notification (or something like it) that I
> could just monitor and react to. But I don't believe there's anything
> actually like that.
>
> I saw something in one of the archives about a carbon function to
> intercept these things, but I didn't see a reference as to what it is.
>
> There are apps that do this, so I know it's possible, but I don't know
> the best approach.
>
> Any suggestions?
>
> -Jim....
> _______________________________________________
> MacOSX-dev mailing list
> <email_removed>
> http://www.omnigroup.com/mailman/listinfo/macosx-dev
>

Related mailsAuthorDate
mlmonitor the clipboard? Jim Thomason Dec 11, 22:00
mlRe: monitor the clipboard? SD Dec 13, 03:14
mlRe: monitor the clipboard? Jim Thomason Dec 16, 23:37
mlRe: monitor the clipboard? Stefan van den Oor… Dec 19, 10:01
mlRe: monitor the clipboard? David Dunham Dec 21, 23:29