سؤال

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