Poll for pressed buttons in Java

Posted by directedition on Stack Overflow See other posts from Stack Overflow or by directedition
Published on 2010-04-12T19:54:24Z Indexed on 2010/04/12 20:02 UTC
Read the original article Hit count: 132

Filed under:
|

I have a WorldWind application build based on the Java SDK. It has a great event handler for detecting when you click on objects, but I've run into a snag. While I can click on and select individual objects, I can't determine if the user is pressing the control key while they click (if they want to select multiple objects). I can implement event handlers for both the mouse and the keyboard, but I can't for the life of me figure out how to tie the two together. How could I make my mouse listener poll the system for a list of currently depressed keys?

© Stack Overflow or respective owner

Related posts about java

Related posts about worldwind