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()); }
1.4m articles
1.4m replys
5 comments
57.0k users