QClipBoard: how to determine if data was copied (Ctrl+C) or cut to the clipboard in another application?
-
My application is clipboard-enabled and is able to accept mime data (not just plain text). Is it possible to know whether the data was put to clipboard by another application with Ctrl+X or Ctrl+C?
-
Windows / OSX / Linux, but Windows is primary.
-
I know under Windows u can try to poll the State of the two keys with the GetAsyncKeyState Function:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms646293(v=vs.85).aspxBut I don't know how to solve that on the other platforms.
-
That's hardly a solution because pressing Ctrl+C or Ctrl+X in another app doesn't trigger any event in my program. Paste is the event I need to handle properly.
-
I think a better way of solving the Problem is to react on the dataChange Signal wich is emitted when the data in the clipboard were changed:
http://qt-project.org/doc/qt-4.8/qclipboard.html#dataChanged
-
The data (file URLs) is copied in another application and pasted into mine. At which point I need to know whether I must delete the original files or not.