Robot not working after another app gains focus

I'm trying to automate some clicking for a program using Robot. The problem is, once I give focus to the target program, Robot stops working (so basically, the initial click into the program works, but it's useless if I can't release the mouse). Intuitively, it seems like the target program has somehow gained a higher priviledge to control the mouse or something if it has focus. Programmatically giving focus back to the java program after every event won't work. Is there a way to fix this, or should I try something more native to Windows like C#?
This target program has a 3D interface and it uses DirectX and stuff, which might be why it (can) eats up control of the mouse. However I just think it's badly programmed, I tried doing some Robot stuff on a game and it seems to work.

billyboy:
How are you checking to see if it works? If you have an application that is processing the click events, and another application covers it, then it will no longer see the click events.
This code:
import java.awt.AWTException;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.InputEvent;
import java.awt.Point;
import java.awt.Robot;
import javax.swing.Timer;
public class JRobot implements ActionListener{
  Robot r;
  Timer t = new Timer(200, this);
  Point p = new Point(512, 512);
  boolean bTime = false;
  int iCount = 0;
  public JRobot(){
    try{
      r = new Robot();
      t.start();
    }catch(AWTException e){
      System.out.println(e.toString());
  public static void main(String[] args) {
    new JRobot();
  public void actionPerformed(ActionEvent e){
    if(bTime){
      p.x = 256;
      p.y = 256;
    }else{
      p.x = 512;
      p.y = 512;
    int iState = iCount%6;
    switch(iState){
      case 1: r.mouseMove(p.x, p.y);
              break;
      case 2: r.mousePress(InputEvent.BUTTON1_MASK);
              break;
      case 4: r.mouseRelease(InputEvent.BUTTON1_MASK);
              break;
      case 5: bTime = !bTime;
      default:
    if(iCount>=100) System.exit(0);
    iCount++;
    System.out.println(iState+" x " + p.x + " y "+ p.y);
}Does keep running and does click and release. I suspect your's is also. If you put one object at (256, 256) and another at (512, 512) you will soon see that they are alternatly chosen and gain and release focus appropriatly, but if one object is on top of the other, then the top object will recieve the click events.

Similar Messages

  • Phone not working after upgrading apps

    upgraded 4 apps this morning, post which the mobile is not working, a few errors which are coming up are "uncaught exception application net_rim_bb_appworld(243) is not responding. process terminated"  also apperror 523 and it restars but most of the things in phone does not work such as applications, emails, sms, cant connect it to desktop software etc etc

    I'm sorry but no one here can help you. The TOU of these forums does not allow discussion of fixes for hacked phones. You'll either need to contact whoever did the hack or use Google to find alternate help.

  • Phone not working after downloading app world

    "Uncaught exception: java.lang.IllegalArgumentException" is coming up on my blackberry curve, i uploaded app world on Friday and my phone has not been working properly since. also states  app error 6303 . i have took battery out whilst phone is on and tried deleting app world . 
    Phone is still coming up with the above message and app error. What else can I do?

    Hi knightnumbersix
    Welcome to the Community
    It seems  IT policy has been enable on your device.Have a look what Knowledge Base says regarding the Error
    KB24925 . I hope it contain something useful informations
    Prince
    Click " Like " if you want to Thank someone.
    If Problem Resolves mark the post(s) as " Solution ", so that other can make use of it.
    Click " Like " if you want to Thank someone.
    If Problem Resolves mark the post(s) as " Solution ", so that other can make use of it.

  • Top Nav buttons not working after publish, but works in app. WHY?

    I have tried to find out why these buttons will not work after publishing. They work fine while in the iWeb app, but not when publishing. I do not have any objects near the top nav buttons. The first site went off without a hitch
    <www.serenitycustompools.net> the second site began the problem with the last page, the nav buttons would not work. Now this 3rd site, none of the nav buttons at top will work after publish, but will work in app. Anyone else having the same probs? None of my pages have the same names or any punctuation marks, and they are simple one word named pages.
    mini intel   Mac OS X (10.4.9)  

    They all work for me, try clearing your browser cache or using another browser.

  • My app store is not working after installing mavericks. When I open app store it repeatedly asking me to login with apple ID and to provide User name and Password for proxy authentication in a loop.I am a newbie to mac,Please help me.

    My app store is not working after installing mavericks. When I open app store it repeatedly asking me to login with apple ID and to provide User name and Password for proxy authentication in a loop.I am a newbie to mac,Please help me.

    Hmmmm... would appear that you need to be actually logged in to enable the additional menu features.
    Have you tried deletting the plists for MAS?
    This page might help you out...
    http://www.macobserver.com/tmo/answers/how_to_identify_and_fix_problems_with_the _mac_app_store
    Failing that, I will have to throw this back to the forum to see if anyone else can advise further.
    Let me know how you get on?
    Thanks.

  • Problem with new version 4.3.2 apps not working " after update to the new version "

    Problem with new version 4.3.2 apps not working " after update to the new version "
    i was in 4.3.1 then i do the update , but now after update i face this problem , so what i Supposed to do ?!!

    Hi There
    Had the same problem as you. App would terminate when launched.
    Solution to working You Tube app:
    -Go to playstore
    - Uninstall app (it doesn't remove the app, only removes the update)
    - "Et Voila", working again.
    This doesn't correct the problem, it's just a workaround for you to be able to use youtube app again.
    Hope it helped.
    Best Regards

  • TS1702 My app store, Apple ID, safari, and most other apps do not work after upgrading to iSO 6, How do i solve this problem?

    My app store, Apple ID, safari, and most other apps do not work after upgrading to iSO 6, How do i solve this problem? Can somebody help me please?

    The App store is a problem for many and I have not seen a solution.
    What is "wrong" with your Apple ID?
    Try the following:
    - A reset. Nothing is lost
    Reset iPod touch: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Restore from backup
    - Restore to factory settings/new iPod.

  • Camera App not working after update to iOS 7.1.1 on iPhone4

    Hi Guys,
    I have recently downloaded iOS7.1.1 ipsw from the apple website for the correct version of my iphone4 [GSM] and updated my phone.
    The camera app is now not responsing at all and i dont even see a picture in the camera app. I tried the update again and found that the problem is still evident.
    Please let me know if we share the same problem and also any solution if you come across.
    Regards,
    Sheikh M

    Updating to iOS 7.1.2 doesnt solving problem at all, even my front camera also begin not working after I did that. Everything's OK when I using rear cam, but just freeze and blurred on screen while switched to the front cam. And have to resetting to go back to rear cam. My iPhone4's camera itself, rear and front, are in good performance before. And I've tried anything such as reset, hard reset, restoring, setting up as new device, etc, without any result since then. If some people say it was about hardware issued, I thing so weird because too many same hardware problems coincident happened at the same moment. So I just only hope the Apple will listening and solving all problems wisely. Thanks b4.

  • HT1937 I have installed an app : Birdfield guide in my iPhone 4. But the app is not working after installation. It shows black screen when opened

    I have installed an app : Birdfield guide in my iPhone 4. But the app is not working after installation. It shows black screen when opened. I need suggestions to make it work or the reasons for not working.

    Yes TeeKnows, try deleting it and download it again. After finished installation if still shows black screen delete it out off 'running apps' by double tapping the home button and swipe it off. If still shows black screen then try fully turning off your iPad (holding the sleep button) and turn back on again.
    I hope I helped
    thanks
    Lydia

  • TS1702 Certain apps will not work after ios6 install.

    Certain apps will not work after ios6 update. Tiger Woods golf will run for about 5 seconds and stop. Have uninstalled/re-installed to no avail.

    My husband had the same problem with some apps after I updated his iPad 2 to iOS 5.  I checked the app store and there were updates for the apps to support the new software.  After updating, all apps work just fine.

  • Ipad camera app not working after update 7.1.1 and using skype on video call

    Hello,
    i updated my mini ipad to ios 7.1.1
    then i used skype for video call...
    It worked fine for a few minutes then the front camera stopped working
    Stopping skype and starting the camera app, i saw that the front camera was no more working...black screen
    instead rear camera was working...
    Then i tried to reset the device (pressing sleep and home button) and uninstalled skype
    Now front camera works more or less, but the camera app seems always almost freezed, i cant change easily the options,
    i cant record a video, only camera for snapshots is working...
    any suggestion?
    is it possible to uninstall the camera app and try to reinstall it?
    Thanks!

    Updating to iOS 7.1.2 doesnt solving problem at all, even my front camera also begin not working after I did that. Everything's OK when I using rear cam, but just freeze and blurred on screen while switched to the front cam. And have to resetting to go back to rear cam. My iPhone4's camera itself, rear and front, are in good performance before. And I've tried anything such as reset, hard reset, restoring, setting up as new device, etc, without any result since then. If some people say it was about hardware issued, I thing so weird because too many same hardware problems coincident happened at the same moment. So I just only hope the Apple will listening and solving all problems wisely. Thanks b4.

  • Most of my apps do not work after 3.1 upgrade

    Most of my apps do not work after 3.1 upgrade. I have done a softboot 2 times and they still willnot connect.

    Are you running the current version of the 3rd party apps on your iPhone - have you checked for app updates with iTunes on your computer?

  • HT4623 Anyone having trouble with App Store install and cloud store buttons not working after 6.1 update?

    Anyone having trouble with App Store install and cloud store buttons not working after 6.1 update? I go to install an app. I hit install and nothing happens. About a minute later it asks me for my password and then it does nothing. The install button goes back to saying install. However the app shows up in my installed list and in cloud but no app installed.

    OK - I found a helpful post - closed app store app and under Settings/General/Date and Time I reset the date and time by switching off "Set Automatically" and then switching it on again. Went back to App Store, launched it and Updatesseems to be working again.
    Go figure? Logical, No!

  • Many apps not working after upgrade

    I have a lot of apps not working after upgrade even apple's remote, splash id etc... Anyone else or is it just me?

    I had trouble with MPR, but since it's free, I just deleted it and reloaded it directly from the App store onto the phone. It had an upgrade, too, that must have clashed with the 2.2 upgrade. Once I did the download, it was fine.

  • Anyone else's iPhone 4s speaker not working after update to iOS 6.1?

    My speaker does not work after updating the software to iOS 6.1. No sound for incoming calls or texts, no speakerphone, no siri, no music or any sounds played from apps. Headphones still work as does anything plugged into the headphone jack. I've check all my settings - everything is correct. I've rebooted and restored settings several times, I've docked it - nothing works.
    Anyone else having this problem? Did anyone have this problem and were able to fix it? Does anyone know if Apple is aware and will be sending another update to fix it? I really don't think it's a hardware problem. Phone is in immaculate condition and never dropped or spilled on.

    As stated...
    Sorry... But...
    The discussion of Jailbroken Devices is against the Terms of Use of this Forum.
    You will need to look elsewhere

Maybe you are looking for

  • HP Omni 220-1050xt Monitor goes blank at random times and will not light up.

    Recently my computer screen starting going blank without any warning.  One minute it is fine and I am working away, then the screen turns black and no key sequence will bring it back.  I have selected a power scheme that has never, never, never set i

  • SQVI - Quick Viewer - Avoid Duplicates

    Hi All, I am running a Quick Viewer and need to display the Count of records for each month. Now I have 2 records for each Employee.(Say 1 for dental  and 1 for medical) Say I have 5 employees,So I could display the Count as 10 records. But in Actual

  • Find button issue in tool bar during upgrade from 4.6c to ECC 6

    Hi All, I came across one issue during the upgarde. In new system ECC 6: When i run the transaction IW51 then give the notification type SE(service notificaton) and then hit enter key. It leads to next screen there enter the value in the FUNCTIONAL l

  • Portal Upgrade Issues

    Hi, 1.Our client is currently in EP6.2.0 and we are upgrading to ECC6.0 and BI 7.0 is there any necessity to upgrade EP to 2004s(EP 7.0)? Do u recommend staying in same version or is it good to upgrade the EP7.0? 2.If we upgrading portal to EP7.0 hav

  • Cisco IVR

    hi, i am using a AS5300 and currently exploring the IVR scripts. Here is my current config aaa new-model aaa authentication login h323 group radius aaa authorization exec h323 group radius aaa accounting connection h323 start-stop group radius aaa se