Results 1 to 11 of 11
  1. #1
    tom99 is offline Member
    Join Date
    Oct 2010
    Posts
    18
    Rep Power
    0

    Default Is there a way to make robot use a virtual mouse?

    Hello i was wondering if there is a way to do the following.
    when you use the robot function to simulate mouse clicks aswell as keyboard.
    can you someway make it use a inbuildt virtual mouse, so you can move your own mouse around aswell as type on another area of the screen while java use a extra virtual mouse and keyboard on another part of the screen?

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is online now Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,873
    Rep Power
    8

    Default

    Not directly, but you could program this functionality. But what exactly are you trying to accomplish? There is probably an easier way to fulfill your requirements.

  3. #3
    tom99 is offline Member
    Join Date
    Oct 2010
    Posts
    18
    Rep Power
    0

    Default

    Its for a macro so when i got large enough screen resolution i can run many at once.

  4. #4
    KevinWorkman's Avatar
    KevinWorkman is online now Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,873
    Rep Power
    8

    Default

    I don't know of a way to (reliably) do this with Robot. You might want to consider writing your own pseudo-macro using doClick() and setText(), depending on what exactly you're trying to do.

  5. #5
    tom99 is offline Member
    Join Date
    Oct 2010
    Posts
    18
    Rep Power
    0

    Default

    But can it be done at all? if i didnt express my self good enough.
    basicly this is what i mean that it use a differnt mouse from your own, a virtual mouse, and if you can make more than 1 thats super!

    and is there a method to implement an external client mouse to IE ?


    Is doClick() and setText() virtual input for running app ? in that case THANK YOU =D
    Last edited by tom99; 10-11-2010 at 07:49 PM.

  6. #6
    KevinWorkman's Avatar
    KevinWorkman is online now Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,873
    Rep Power
    8

    Default

    Quote Originally Posted by tom99 View Post
    But can it be done at all? if i didnt express my self good enough.
    basicly this is what i mean that it use a differnt mouse from your own, a virtual mouse, and if you can make more than 1 thats super!
    You can't use a "virtual mouse" with just Robot. You could try to use the normal mouse, but as soon as you have more than one program using Robot running at once, things are going to go crazy.

    But really, you should just try it and see what happens. Maybe it will be okay for your needs. If you find you do have a problem, then post a small runnable program and ask a specific question.

    Quote Originally Posted by tom99 View Post
    and is there a method to implement an external client mouse to IE ?
    I don't know what that means.

  7. #7
    tom99 is offline Member
    Join Date
    Oct 2010
    Posts
    18
    Rep Power
    0

    Default

    I mean, if you can add virtual client mouse to internet explorer then simulate tasks with internet explorer minimized ?

    What woud be the difference between robot.delay and thread.sleep ?
    Last edited by tom99; 10-11-2010 at 10:20 PM.

  8. #8
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,188
    Rep Power
    19

    Default

    No, you can't interact with a minimized window from a Java program. Not unless it exposes a public API that allows you to. IE or any other browser does not, which is A Good Thing™.

    What exactly are you trying to accomplish?

    db

  9. #9
    somanayr is offline Member
    Join Date
    May 2010
    Posts
    27
    Rep Power
    0

    Default

    Quote Originally Posted by tom99 View Post
    Hello i was wondering if there is a way to do the following.
    when you use the robot function to simulate mouse clicks aswell as keyboard.
    can you someway make it use a inbuildt virtual mouse, so you can move your own mouse around aswell as type on another area of the screen while java use a extra virtual mouse and keyboard on another part of the screen?
    The java.awt.Robot class controls the pointer. Not a magical pointer from unicorn land. Your pointer. So what is there to do about it? Well, you can download some virtual machine software and run your program in a separate virtual machine.
    Are you trying to write a bot for a game? I'm trying to learn BCEL and I think that would be an excellent exercise. If you're trying to write a bot for Runescape... www.runedev.info www.powerbot.org <-- open source bots to use as examples.


    EDIT:
    A really buggy, glitchy, detectable way would be to have the mouse switching back and forth between your happy places... but if whatever you're trying to macro has any macro defenses, you're going to need a good excuse after you're caught.
    Last edited by somanayr; 10-12-2010 at 01:33 AM.

  10. #10
    tom99 is offline Member
    Join Date
    Oct 2010
    Posts
    18
    Rep Power
    0

    Default

    I know you can use a virtual machine but if you are running a os witch support win32 programs such as winxp, then it takes atleast 512mb of ram of your host.
    and if your host only got 1gb ram then its a bad idea. I know how to write a macro, but not how i can use one witch uses "magical cursor from unicorn land" lol

  11. #11
    somanayr is offline Member
    Join Date
    May 2010
    Posts
    27
    Rep Power
    0

    Default

    As far as I know, there are not modules for virtual cursors, although I was flipping through SIGAR and it seemed like that might have some sort of support for it. I didn't really look into it. As far as I'm aware, you can't have 2-3 pointers going at once, and if you do want to do it, Java isn't the language to do it in. (probably better to do it in a lower level language like c++ or c# so you have more control)

Similar Threads

  1. Robot
    By PhQ in forum AWT / Swing
    Replies: 13
    Last Post: 08-26-2010, 12:10 AM
  2. Robot Game
    By yanipao in forum New To Java
    Replies: 1
    Last Post: 03-24-2010, 10:51 AM
  3. Robot Game
    By Galore in forum New To Java
    Replies: 7
    Last Post: 03-21-2010, 06:14 PM
  4. Mouse Listener for mouse floating over object?
    By Krooger in forum AWT / Swing
    Replies: 1
    Last Post: 11-18-2009, 04:34 AM
  5. How to make virtual keystroke output?
    By Lynx09 in forum Suggestions & Feedback
    Replies: 2
    Last Post: 03-31-2009, 12:33 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
  •