aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes java.awt.Robot Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "java.awt.Robot" Watch "java.awt.Robot" New topic
Author

java.awt.Robot

Ryan Bailey
Ranch Hand

Joined: Feb 26, 2002
Posts: 134
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


SCJP 1.4, SCWCD
Java: The power, elegance, and simplicity of a hand grenade
Ryan Bailey
Ranch Hand

Joined: Feb 26, 2002
Posts: 134
Bueller?....Bueller?....Anyone?....Anyone?....
Ryan Bailey
Ranch Hand

Joined: Feb 26, 2002
Posts: 134
bump...
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
I would be surprised if this was possible in pure Java, as it would be a serious security problem.

Moving to Swing/AWT...


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
And read http://faq.javaranch.com/view?PatienceIsAVirtue ...
Ryan Bailey
Ranch Hand

Joined: Feb 26, 2002
Posts: 134
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

Joined: Jul 11, 2001
Posts: 14112
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!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.awt.Robot
 
Similar Threads
jakarta commons-net; using control channel during ftp
java.awt.Robot
Secure FTP Data Channel
Problem in Sending Mail Using Sockets
A good keyListener for mulitple key's pressed