-4

Can I press combination of keys in java like alt+F4 or alt+Shift+Z! I have tried my best to do this and follow to many instruction but in vain please help me!

I am follow This Link

Bilal Mustafa
  • 750
  • 7
  • 16
  • 2
    try Robot class in java – ihsan kocak Nov 08 '17 at 11:36
  • You can press whatever keys you want. Do you mean you want a Java application to press those keys? Or you want Java to detect those keys being pressed? – khelwood Nov 08 '17 at 11:37
  • 2
    Possible duplicate of [how to send CTRL+Z keyEvent in java using Robot class](https://stackoverflow.com/questions/9047710/how-to-send-ctrlz-keyevent-in-java-using-robot-class) –  Nov 08 '17 at 11:37

1 Answers1

1

Yes, you can use the Robot class

You can make a keypress easily:

Robot robot = new Robot();
robot.keyPress(/*keycode*/);//keycode that you want
Ashish Kumar
  • 916
  • 2
  • 15
  • 32
canillas
  • 414
  • 3
  • 13