• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.awt.Robot

 
Ryan Bailey
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I'm using the Robot class to send commands to windows to control the mouse and keyboard for work. Everything seems to be working fine but for the life of me I cannot send a Ctrl+Alt+Delete command to unlock my workstation so I can begin processing. Has anyone EVER done this before? A simple sniplet of my code is below:
roboCop.keyPress(KeyEvent.VK_CONTROL);
roboCop.delay(500);
roboCop.keyPress(KeyEvent.VK_ALT);
roboCop.delay(500);
roboCop.keyPress(KeyEvent.VK_DELETE);

It seems like when keyPress(KeyEvent.VK_ALT) is called my previous command is released....I have divided this task up and was able to do control V to past and alt A to navigate my menu, but when I put the commands together they don't seem to work.

Any suggestions would be appreciated.
Thanks,
Ryan Bailey
 
Ryan Bailey
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bueller?....Bueller?....Anyone?....Anyone?....
 
Ryan Bailey
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
bump...
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would be surprised if this was possible in pure Java, as it would be a serious security problem.

Moving to Swing/AWT...
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And read http://faq.javaranch.com/view?PatienceIsAVirtue ...
 
Ryan Bailey
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ilja Preuss:
I would be surprised if this was possible in pure Java, as it would be a serious security problem.

Moving to Swing/AWT...



Be very suprised, it is very possible. Sorry for having antisocial behavior with my impatient posts!
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ryan Bailey:
Be very suprised, it is very possible.


OK, I'm surprised. So what did you do to make it work?

Sorry for having antisocial behavior with my impatient posts!


Apology accepted!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic