Reputation: 21
I am writing a program that expands the usage of the clipboard, but I need to tell when the user has either cut, copied, or pasted something so I can write code accordingly to that. I need to know how I can check to see when the user has entered a command like this.
Upvotes: 2
Views: 456
Reputation: 43158
I don't know if detecting keys is the best way to do that.
Anyway, you can find out if the clipboard contents changed by monitoring it.
Check out this article: How to monitor the clipboard in Visual Basic
Upvotes: 1
Reputation: 19495
The problem with trapping keystrokes is what if someone clicks the "Copy" button on the toolbar, or goes to Edit > Copy on the menu?
What you probably need to do is trap an event emitted by the Clipboard itself for whenever it changes. Glancing at Google it seems there isn't a .NET api yet, but there is still an old Win32 one... Create a Windows Clipboard Monitor in VB
Upvotes: 2