I'm developing an application which calculates and displays information which then needs to be copy and pasted into a proprietary program. To make this easier for the user, I'd like to enable them to ctl+v, move cursor, ctl+v, etc., and have my program pick up on the pastes and update the Clipboard automatically after every paste.

Is there any straightforward way of doing this? The only things I've found involve accessing DLLs and the like, and this isn't a project I can spend too much time on at the moment.

有帮助吗?

解决方案

It's possible, check this project out: https://code.google.com/p/jnativehook/

That will allow you to listen to key events even when your app doesn't have focus. It won't work if they don't paste with a keyboard shortcut, though.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top