Results 1 to 2 of 2
  1. #1
    Rmond1254 is offline Member
    Join Date
    Feb 2009
    Posts
    1
    Rep Power
    0

    Default Help with Java Robot and Runtime Class

    I want to know what list of codes do you use to press certain keys

    example:
    robot.keyPress(KeyEvent.VK_H);
    robot.keyPress(KeyEvent.VK_I);

    which press the h key and i key.
    But what are the codes for the Microsoft, print screen, escape, home, ect. keys (those special keys).

    Also how do you create an instance of the runtime class?
    I tried:
    Runtime Run = new Runtime();
    But it didn't work.

  2. #2
    toadaly is offline Senior Member
    Join Date
    Jan 2009
    Posts
    671
    Rep Power
    6

    Default

    For Runtime, try Runtime.getRuntime(). It's a singleton, so you can't instantiate it.

    In regards to key mappings, look at java.awt.event.KeyEvent for all the special key codes.

Similar Threads

  1. Java Robot commands not working
    By CoolLove in forum Java Applets
    Replies: 2
    Last Post: 01-13-2009, 03:58 PM
  2. Newbie - Robot Class
    By drasgear in forum New To Java
    Replies: 2
    Last Post: 11-14-2008, 05:46 PM
  3. Robot Class
    By Jessie Madman in forum New To Java
    Replies: 3
    Last Post: 05-15-2008, 05:13 AM
  4. Example of RunTime class
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 01-04-2008, 10:32 AM
  5. Robot Class
    By jfredrickson in forum New To Java
    Replies: 2
    Last Post: 07-11-2007, 10:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •