Question

Java simple problem I need to make a program that will press CTR + ALT +...

Java simple problem

I need to make a program that will press CTR + ALT + F1 key automatic ly when it been called.

0 0
Add a comment Improve this question Transcribed image text
Answer #1


import java.awt.AWTException;
import java.awt.Robot;
import java.awt.event.KeyEvent;


public class objSize {
  
  
  
public static void main(String [] args) throws AWTException {

//you can do it using robot class
Robot r = new Robot();
//pressing all at once
r.keyPress(KeyEvent.VK_CONTROL);//PRESSING CONTROL+
r.keyPress(KeyEvent.VK_ALT);//pressing alt+
r.keyPress(KeyEvent.VK_F1);//pressing f1
  
  
//to release them
/*
r.keyRelease(KeyEvent.VK_CONTROL);//PRESSING CONTROL
r.keyRelease(KeyEvent.VK_ALT);//pressing alt
r.keyRelease(KeyEvent.VK_F1);//pressing f1
*/

}
  
}

Add a comment
Know the answer?
Add Answer to:
Java simple problem I need to make a program that will press CTR + ALT +...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT