Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to detect clipboard copy
#4
I'm processing copying in other applications triggered on Cc:

Code:
Copy      Help
;;keep stack of recently copied text

int+ cc_next    ;; global variable to hold last copied position
str+ cc_last    ;; last string copied
def MAX_CLIPBOARD 30

;;retrieve clipboard contents
str s.getsel
s.trim
if s.len > 3 and s.len < 30000 and s <> cc_last
,;;determine next filename to store text in
,cc_next + 1
,if cc_next > MAX_CLIPBOARD
,,cc_next = 1

,;;write to file
,s.setfile(ClipFilename(cc_next))

,cc_last = s
,
key Cc

This results in several applications on my computer reporting the inability to access the clipboard every other time Ctrl+C is pressed. Is there a better way? A true trigger on the WM_DRAWCLIPBOARD notification would be preferable since it would also handle copy via the mouse, cut, copy with another keyboard shortcut, etc. Thanks.


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)