0

I have been trying to create a very simple java clipboard application.

When the user hits a predefined keyboard shorcut (for example CTRL + 1), I want my application to paste the contents of my system clipboard, into any other application.

From what I have researched, Java Swing keybindings and keyboard listeners do not work when the Java application is minimized or not in focus.

I have been looking at JNA (Java native access), and some of the source files. But this is my first time using JNA and first time trying to paste into other applications. And i can't seem to figure out where to even start.

Are there any pointers that you guys/girls can provide?

Thanks, Julie

  • A brief search shows existing packages that do this: https://github.com/kwhat/jnativehook – Daniel Widdis May 27 '16 at 22:02
  • Welcome to StackOverflow, JulieFoxSteven. A brief search of the site shows your question has been asked before and answered with some sample code. Please try searching your question first before asking to avoid duplication. See http://stackoverflow.com/questions/16179923/how-to-capture-global-key-presses-in-java, http://stackoverflow.com/questions/3078646/jna-keyboard-hook-in-windows?rq=1 – Daniel Widdis May 27 '16 at 22:07

0 Answers0