I have a Java function in which I want to test if the control key is being held down. How can I do that?
Edit: I am using swing for gui.
use the "isControlDown()" boolean:
public void keyPressed (KeyEvent e) { System.out.println(e.isControlDown()); }
2.1m questions
2.1m answers
60 comments
57.0k users