Monday, 9 September 2013

Detect CTRL key pressed in Java without any event passed

Detect CTRL key pressed in Java without any event passed

I'm developing an extension in Java for a native Windows application. My
extension is launched by clicking on a button in the host application.
I've been asked to provide a different behavior for the Ctrl+click action,
but I don't have access to the mouse event since it comes from a non-Java
application and the method that I must implement is parameterless.
I can use Swing and anything else in the JDK (Java 6). What I need is a
way to test whether the Ctrl key is down at the beginning of my code.

No comments:

Post a Comment