Results 1 to 3 of 3
  1. #1
    Icandoit is offline Member
    Join Date
    Oct 2013
    Posts
    13
    Rep Power
    0

    Default Type colon my keyboard?

    I've tried making my robot print out colons but I just can't seem to.

    I tried doing

    Java Code:
                robot.keyPress(KeyEvent.VK_COLON);
    and

    Java Code:
                robot.keyPress(KeyEvent.VK_SHIFT);  
                robot.keyPress(KeyEvent.VK_SEMICOLON);
    and neither seem to work, in fact I can't seem to get any symbols typed out (I don't want to copy to clipboard and paste out) (yes, I do keyRelease as well -> I've tried a bunch of stuff)

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,422
    Blog Entries
    7
    Rep Power
    28

    Default Re: Type colon my keyboard?

    Think about it what you do when you want to type a colon: press Shift, press the semi-colon key, release the semi-colon-key, release the Shift key; you forgot to release the keys.

    kind regards,

    Jos
    Build a wall around Donald Trump; I'll pay for it.

  3. #3
    jashburn is offline Senior Member
    Join Date
    Feb 2014
    Posts
    219
    Rep Power
    6

    Default Re: Type colon my keyboard?

    This works for me...
    Java Code:
    robot.delay(500);
    robot.mouseMove(1200, 300);  // Move to my text editor
    robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
    robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
    
    robot.delay(250);
    robot.keyPress(KeyEvent.VK_SHIFT);
    robot.keyPress(KeyEvent.VK_SEMICOLON);
    robot.keyRelease(KeyEvent.VK_SEMICOLON);
    robot.keyRelease(KeyEvent.VK_SHIFT);
    (The delays are just for my own benefit.)

Similar Threads

  1. Splitting a japanese sentense using colon
    By sarathuob in forum New To Java
    Replies: 4
    Last Post: 01-23-2013, 09:32 AM
  2. Replies: 2
    Last Post: 12-21-2012, 05:32 AM
  3. Replies: 4
    Last Post: 08-01-2011, 11:29 AM
  4. Question mark colon operator question
    By orchid in forum Advanced Java
    Replies: 9
    Last Post: 12-19-2010, 09:49 AM
  5. [SOLVED] what does the colon means?
    By PureAwesomeness in forum New To Java
    Replies: 3
    Last Post: 02-04-2009, 06:17 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
  •