Checking Mouse position every second?

Hello,
I have a program that needs to check the mouse position on the program's window every loop, but if I use MouseMotionListener's mouseMoved(), it is not what I want because it checks ONLY when I move my mouse, it doesn't check if I don't move my mouse. For example, I have a while loop will check if the mouse pointer now in the area of (25, 50), the program will do something. Thus what should I use? I tried moveEntered(), it doesn't work as well any hints?
Andy

okay, for example, like Warcraft 3, starcraft type RTS game, when you move your mouse pointer to the edge of the screen, the screen will scroll over the map. But remember when you move to the edge of the screen, it will move automatically so you don't need to move your mouse until you want to stop moving the screen, you move away your pointer from the edge right? With mouseMoved(), it doesn't work that way cuz whenever it checks mouseMovement only, if there is no mouse movement, it doesn't know whether if the pointer is on the edge or not. How do I check that, since I don't wanna use a Runnable class to do that, I rather use a loop to check it. Which method that I can get the mouse pointer position by not implementing MouseListener.
Andy

Similar Messages

  • Mouse pauses every 2.5 seconds

    Got a brand new 27 inch 3.06 Ghz Core 2 Duo iMac (2009). The magic mouse AND any USB mouse that I plug into it pauses at the same interval about every 2.5 seconds. It's just enough to screw up everything you are trying to do.
    Tinkering with it, I have managed to figure out that it only does it when I use an external monitor plugged into the iMac...
    I have an external 24 inch monitor plugged into the iMac to extend my desktop. The external monitor has 2 inputs (DVI and VGA). When I have both the iMac and the 24 inch monitor set to Mac (DVI), the mouse works just fine. But when the external monitor is set on the Windows machine (VGA), the mac mouse (Magic mouse or USB mouse) pauses every 2.5 seconds. I don't know why monitor input settings would cause the mouse to pause and I haven't seen any threads with the same problem. Any ideas?

    The 27-inch iMac is the first (and only) Mac to make double-use of its video port.
    I think you have already shown it is somehow related to the Mini DisplayPort, and you can easily reproduce the problem on-demand. Since Mac OS X still sees the second display, even when it is switched over to the VGA input, it may not be related to the new video input capability.
    As a test, what happens if you put it into the state where the pausing is going on, then disconnect the adapter on the back of the iMac. I would assume iMac would pause for a second and reset to having only its built-in display, and the ongoing pausing issue would stop. Then, reconnect the adapter (display still set to VGA with active input). The iMac should reset to having the external display. Does the pausing issue start happening again?
    Here's another test. With the display set to DVI, insert the Mac OS X installation disc and restart with the C key held down. This will force start up from the optical drive. When you get to Installer, you should see the default Desktop background on the external display, and that will indicate it is being recognized and used. You should be able to move your mouse cursor onto it, although the arrangement may be different. Now, do the thing that usually causes the pausing. When you are started up from a different system, does the pausing still occur?

  • Erratic Magic Mouse (jumps accross screen precisely every second)

    The title sums it up really. Every second (on the second) the cursor will jump very slightly on the screen. Probably only about 2 or 3 millimeters. It's annoying, but it's not a huge deal.
    What IS a huge deal is when the mouse decides to jump the cursor to a random point on either of my two screens. Extremely annoying especially if the second screen isn't even turned on and it jumps over there.
    What I've noticed is that it seems to do it more frequently when there is a higher load on the system. With a 'normal' workload (internet browsing, skype, listening to music etc) it will do this big jump approximately every minute. But when there is a high load, like when I'm trying to play a game it will happen every couple of seconds, rendering most games totally unplayable! (The number of times my character has ran off the edge of a cliff because of this is maddening).
    Now here's the thing, I took my iMac and Magic Mouse to my local Apple Store and wouldn't you know it, nothing happened. It behaved itself perfectly. But they were very good and swapped my old Magic Mouse for a brand new one out of a retail package anyway. Happy, I bring it home and immediately it's doing it again exactly as before with the brand new mouse!
    My iMac is the 2010 27" Core i5 version upgraded with 12gb of ram, in case any of that is relevant at all.

    I don't believe this. I've just spotted this post by user Ratzelda. He says that it's an issue with having dual (or multiple) monitors connected but powered down. I hadn't noticed any change in the mouse's behaviour when using the second monitor, but out of curiosity I just switched it on and sure enough the mouse is behaving normally now!
    That explains why the mouse didn't respond erratically when I took the iMac to the Apple Store, because I didn't take my second display with me.
    It seems like this is a known issue, and yet no patch has been released by Apple to fix it? Having to continuously run both monitors when it's not needed seems very energy inefficient to me. What is Apple playing at?

  • . How to put Check box in every row in Table

    Hi Friends,
    I have one doubt in Webdynpro with java. How to put Check box in every row in Table?
    For Exam My requirement is I am getting BAPI from ECC System. So I have to go given input details in first view and output details in SecondView. So in Second View I will taken Table that data will displayed in rows. I need each and every row first I need check box.
    Here Select Check Box of particular row then click GetData button.  That row data will be displayed in one popup window.
    In table suppose 6 rows available in table. Every Row first Check box available.
                             empid, name, sal  ,firstname, last Name
                             empid, name, sal  ,firstname, last Name
                             empid, name, sal  ,firstname, last Name 
    How to put Check box in every row in Table?  can you send any examples applications
    Regards
    Vijay

    Hi Friend,
    When we are getting BAPI From ECC System. that BAPI Have nodes and Attribues...in under node we can't create "CheckBox"
    attribute.
    So i am doing like this.I am create on Checbox attribue out side of Node. Check Box data type is boolean.
    next i am creating table ( that table having rows and columns) Right click on table-->Click on Insert GroupedColumn->again right click on nsert GroupedColumn---> Here Select Check Box.
    Okay...here i am getting one problem. i have got Check boxes .But i am select check box in  first row. that time all check boxes will be selected.
    i need select first row check box that only first row will be selected suppose i selected second row check box that only second will be selected.
    i need this can u help me....
    Regards
    Vijay

  • "Ghost" page numbers on every second page - how to remove?

    Hi,
    I'm setting a short book with Pages and after importing from Word, I'm seeing duplicate, partially hidden additional page numbers on every second page. I'd like to remove them entirely, keeping Pages' page numbering. Removing and inserting page numbers doesn't help and the second set of numbers can't be selected in any way (clicking, dragging don't work). One solution would be to re-import from word, deselecting page numbers beforehand, but I'd rather like avoid this step as I made many changes in Pages.
    Here's a screenshot showing the duplicate page numbers: http://dl.dropbox.com/u/3304376/pages_bug.png
    Does anybody have an idea how to remove them?

    Hello,
    Sometimes in the process of importing from Word, page numbers are improperly converted to Master Objects or Background Objects. Go to Format > Advanced > Make Master Objects Selectable. Then, with the cursor in the Margin of the document, press the Command Key (Cursor changes to an Arrow) and drag the cursor diagonally across the page number to select it. Then press the Delete key and the number should be gone. You need to check carefully to make sure that you have eliminated all the instances. There may be one per Section.
    Jerry

  • "Last devices used" menu every second over Ovi map...

    Hello all,
    I installed Ovi Maps on my phone, and have a huge problem with it: Every second the"Last devices used" pops up and goes away again.
    Since a few years I own (and use) a Nokia N95, and I just used 'Setup Nokia Maps Update 1.0.8.exe' to get Ovi maps on my phone. Apparently I had to use 'Nokia Software Updater' to make sure I got the latest version. Done that too.Next step is to use the Nokia Map Loader to get the maps on there. Done that too.
    Here is the version info of the installed map:
    I have Bluetooth enabled. Now, when I use the maps, every second the"Last devices used" pops up and goes away again. Mildly irritating would be a severe understatement here. Switching Bluetooth off and starting the map again gives the question "Bluetooth is currently switched off. Switch on?". Every second. It seems impossible to answer the popup-question or do something with the popup-menu.
    Is this a known prob by anyone, and can you please tell me a fix or workaround (preferably a fix of course)?
    Thank you,
    wlamee
    Solved!
    Go to Solution.

    And I got a nippy reply from the Benelux Nokia Care.
    The trick is I had to go to Tools -> Settings -> General -> Positioning -> Positioning Methods, and switch off 'Bluetooth GPS'. I think I always ahd this switched on and it never complained with the standard Nokia maps, but I'm not sure - I think I saw that menu only once, when I was palying with my GPS and the original maps.
    But hey, it's fixed. Cool!
    wlamee

  • Digital (optical) audio jerks on and off every second or so

    Sudenly got this annoying problem, when sound on optical audio cuts off and on again repeatedly every second or so. As if there was a wire with bad connection. The optical cable is fine thou, i checked with my other macbook.
    So that must be a problem with my main macbook. I restarted it in hope that its just a software glirch, but the problem remains.
    Sound from MBs speakers ir fine.
    What to do?

    Now there is no sound at all. When i connect optical toslink there is no sound. When i connect usual 3.5mm jack to analog system, it sounds ok.
    I can see the red light, but there is no sound. What could it be? Software or hardware problem?

  • MAC OS X + stage.fullScreenSourceRect + renderMode set to GPU = problem with mouse position

    When setting stage.fullScreenSourceRect, stage.displayState to StageDisplayState.FULL_SCREEN_INTERACTIVE; and renderMode to GPU, mouse position is read incorrectly. This is not only for mouseX and mouseY position, but also all the mouse interactions with Sprites, Buttons etc are not working correctly.
    Anybody know a solution for this issue?
    Here is the bug reported, but there is no response yet.
    https://bugbase.adobe.com/index.cfm?event=bug&id=3486120
    Greg.

    Bump up.
    Anybody has the same problem and have an idea how to fix it? Or please just check if you have the same problem.. I'm going to submit my game "Amelia and Terror of the Night" (successfully added to iOS store) to MAC App Store but can't do it while this problem appears.
    I am disappointed nobody  even verified the bugs I submitted at  the bugbase.adobe.com for AIR 3.5 and 3.6
    thanks
    Greg

  • Suspends only every second time when lid closed

    Hello everybody, my problem is as the  subject: to suspend I have to close usually the laptop lid twice.
    I'm using kde, but I have also used years ago fluxbox, tweaking scripts and using laptop-mode (which is not running now). Thanks in advance for every idea where to look.
    /etc/acpi$ cat handler.sh
    #!/bin/sh
    # Default acpi script that takes an entry for all actions
    minspeed=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq`
    maxspeed=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq`
    setspeed="/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed"
    set $*
    case "$1" in
    button/power)
    case "$2" in
    PBTN|PWRF)
    logger "PowerButton pressed: $2"
    poweroff
    logger "ACPI action undefined: $2"
    esac
    button/sleep)
    case "$2" in
    SLPB|SBTN)
    echo -n mem >/sys/power/state
    logger "ACPI action undefined: $2"
    esac
    ac_adapter)
    case "$2" in
    AC|ACAD|ADP0)
    case "$4" in
    00000000)
    echo -n $minspeed >$setspeed
    #/etc/laptop-mode/laptop-mode start
    00000001)
    echo -n $maxspeed >$setspeed
    #/etc/laptop-mode/laptop-mode stop
    esac
    logger "ACPI action undefined: $2"
    esac
    battery)
    case "$2" in
    BAT0)
    case "$4" in
    00000000)
    logger 'Battery online'
    00000001)
    logger 'Battery offline'
    esac
    CPU0)
    *) logger "ACPI action undefined: $2" ;;
    esac
    button/lid)
    case "$3" in
    close)
    logger 'LID closed'
    open)
    logger 'LID opened'
    logger "ACPI action undefined: $3"
    esac
    logger "ACPI group/action undefined: $1 / $2"
    esac
    # vim:set ts=4 sw=4 ft=sh et:

    I actually do not understand who comands at the end - this handler.sh or the settings in Kde-powermanaging, I guess it's the second, I did remove the actions for suspend on lid close time ago. I made a test now, when I change handler.sh and check "do nothing when lid close" in kde powersettings happens exact the same: performs suspend every second time only.
    button/lid)
    case "$3" in
    close)
    logger 'LID closed'
    /usr/sbin/pm-suspend
    open)
    logger 'LID opened'
    logger "ACPI action undefined: $3"
    esac
    Last edited by steff (2012-07-21 17:08:46)

  • HT3205 Green light flashing on and off every second

    What is indicated by the green light on the charger going off and on every second?

    Usually it is a charger or battery issue.
    Try a SMC reset:
    http://support.apple.com/kb/HT396
    Use the method which applies to your Mac, a battery you should remove (most likely)
    You can also check the battery status by clicking on the Apple logo and About This Mac, More info or system profile (depending on which oSX you are using as it is not in your profile) Power in the left side bar and check battery health and other stats.

  • Load frames conform mouse position

    Hi.
    Look this site:
    www.perpendicular.tk
    This site use javascript to show image by image. It is not a 3D model, only images are showed one by one in relation position mouse.
    In actionscript, how Can I make this?
    I think that I need start putting the images in frames. After, Stop(). When Mouse clicked, I need to compare with the last position and verify the direction, if mouse direction is left ou right and gtonextframe.
    But how can I make this accelerate system. Look in site that the image are load more fast is mouse moviment is fast...
    Thanks and sorry for my english...

    Here, I have the side that my model is rotated, left or right and get the speed of mouse is moved. Speed like 5000 is vary fast. So in interval, I need to create a factor that go to increment the time until == 500 when the movieclip is total stop. If speed iguals 5000, so I start interval witth 10 miliseconds and increment to 15, 27,35 and so...But for this, I need create a factor, to multiply the 10 miliseconds and get the value to the next times...
    Realy, sorry my english, I try but I imagine the dificult to understanding that I write...
    var _oX:Number = stage.mouseX;//last mouse x position
    var _oY:Number = stage.mouseY;//last mouse y position
    var _velX:Number = 0;//velocity x per second
    var _velY:Number = 0;//velocity y per second
    var _speed:Number = 0;//change in position per second
    var _mouseTimer:Timer = new Timer(50,0);
    _mouseTimer.addEventListener( TimerEvent.TIMER, updateCurrentMouseVelocity);
    _mouseTimer.start();
    function updateCurrentMouseVelocity(e:TimerEvent):void
        var nX:Number = stage.mouseX;
        var nY:Number = stage.mouseY;
        var dx:Number = nX - _oX;
        var dy:Number = nY - _oY;
        _oX = nX;
        _oY = nY;
        _velX = dx * 1000 / _mouseTimer.delay;//per second
        _velY = dy * 1000 / _mouseTimer.delay;//per second
        _speed = Math.sqrt( _velX * _velX + _velY * _velY );
    trace(_velX);
    //desascelarating function
    var teste:Number = 0;
    //teste = setInterval(someFunction, (100));
    var sfunc_i:Number = 0;
    var timer:Number = 100
    function someFunction() {
    sfunc_i++;
        clearInterval(teste);
        teste = setInterval(someFunction, (timer));
    timer = timer + 100;
    mc.nextFrame();
    if (timer == 500){
       clearInterval(teste);
    this.addEventListener(MouseEvent.MOUSE_DOWN,mouseD);
    this.addEventListener(MouseEvent.MOUSE_UP,mouseU);
    this.addEventListener(MouseEvent.MOUSE_MOVE,mouseM);
    var factor = Number;
    var xmouse = 0;
    var initialPnt;
    var key;
    var keyAnt = 0;
    var actualFrame = 0;
    function on_enter(event:Event):void{
    if (testa == true){
        if(xmouse == 0){
          xmouse = mouseX;
        }else{
        if(xmouse > mouseX){
         trace("left");
         xmouse = mouseX;
         teste = setInterval(someFunction, (_velX));
        }else if(xmouse < mouseX){
         trace("right");
         xmouse = mouseX;
    var testa = false;
    function mouseD(e:MouseEvent):void{
    testa = true;
    function mouseU(e:MouseEvent):void{
    testa = false;
    function mouseM(e:MouseEvent):void{

  • Charge led blinks every second when Laptop NX9420 is turned off.

    I have a new battery, in a HP Compaq NX9420 and it can run the laptop for 2 hours isch,
    it can also run it on power adaptor only, battery removed, so both battery and charger is ok.
    But,
    When turning off the laptop from within windows it goes off and all is normal, after some 3-12 hours the charge led starts to blink amber/orange every second, if I press on/off button nothing happens, I have to remove the battery and slap it in again then it starts,
    (after pressing on/off ofc.) the battery is slightly drained what I can see?
    checked everything in bios but nothing
    tested also HP Battery check and it says all ok.
    Motherboard busted?
    RTC battery weak? I still keeps track of time and settings bioswise.

    Hi,
    I don't know people call this but we normally call it as an "handsake", all smart batteries should do this way.
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • How to read two files (one is updating every second, the other is constant) simoltaneously

    Dear All,
    I will appreciate if somebody help me.
    I want to read two files, one is temperature wich is updating every second, and the other is hysteresis energy which has specific rows and is constant.
    I got a program in discussion forum which read a file as it is updating. I checked this program in my case and it works.
    Then I added reading hysteresis energy file to the existing file. But while i am running the program, the hysteresis energy file is read with all rows.
    But the aim is that everytime which temperature updates, I need to read just one row of the hysteresis energy file.
    so, in this way in every second i have a new temperature data and one row of the other file.
    I tried to used "for loop" inside the program, but it did not work, becuase reading temperature will be stopped untill for loop ends.
    I attached the program.
    Could somebody help me how to read just one row of hysteresis energy file everytime temperature updates?
    Solved!
    Go to Solution.
    Attachments:
    Readfiles.vi ‏23 KB

    I do not understand relationship between your two files.
    You have another VI or app that is writing data to both files and when new temperature data added you wish just to read the new data and then read one new line of the hysteresis file?????
    But is one is constant, why do you need to keep reading it?
    Anyway…
    The “Read From Spreadsheet File.vi” preformed an Open and a Close for each time it is called (if you will open the VI up and drill down and you will see). So that resets the file pointer back to the beginning and there for will read in the whole file from the first to the last each time if you do not set the start of read offset or number of rows.
    Now the Read from Binary File does not reset the file pointer and leaves the file pointer just past the last byte read so it will start with any new bytes automaicly only giving you the new data.
    I do not think you need to do the math with the Previous EOF=0 and the File size to get what I think you are trying to do.
    Plus use shift reg for the Data string instead of local var
    Set the mechinacl action of the stop botton to Latched
    So you do not need to init the two controls
    Also, I do not get the End of file encountered error (4) from the Read from Binary file if I attempt to read past. It just returns and empty string.
    Omar
    Attachments:
    Readfiles.vi ‏22 KB

  • ITunes causing a "pause" in my PC every second or so.

    Thanks for anyone reading this.
    I have a "pausing" problem when iTunes is maximized or in a window (problem goes away if iTunes is minimized). The problem also goes away if the display on the top portion of iTunes is the graphical equalizer instead of displaying the track info. Basically whenever iTunes is running and the track info is displayed my computer gets this pause every second or so in every application even just moving the mouse on the desktop (dual monitor setup). If I minimize iTunes or change the display to the equalizer that little annoying pause goes away. obviously I can just keep it minimzed or on the equalizer but sometimes I like to look at the disply to see what song it is and I hate to have to go thru so much work just to see the song title. Just curious if anyone has experienced anything like this??
    Thanks in advance for any replies or suggestions .....
    - AH
      Windows XP  
      Windows XP  
      Windows XP  

    Thanks for anyone reading this.
    I have a "pausing" problem when iTunes is maximized or in a window (problem goes away if iTunes is minimized). The problem also goes away if the display on the top portion of iTunes is the graphical equalizer instead of displaying the track info. Basically whenever iTunes is running and the track info is displayed my computer gets this pause every
    second or so in every application even just moving the mouse on the desktop (dual monitor setup). If I minimize iTunes or change the display to the equalizer that little annoying pause goes away. obviously I can just keep it minimzed or on the equalizer but sometimes I like to look at the disply to see what song it is and I hate to have to go thru so much work just to see the song title. Just curious if anyone has experienced anything like this??
    Thanks in advance for any replies or suggestions.....
    - AH
    Windows XP
    My situation wasn't ever this bad, but I noticed that the larger my library was, the slower it seemed to navigate. Anyway, my mouse never really paused every few seconds, but the best I can guess is that you're computer's resources may be being used a lot just to display and navigate iTunes. Don't quote me on this, but if this is indeed the cause of you're problem, you might either have to put up with the pauses, or buy a more powerful computer.
    Actually, if possible, you might want to try closing all programs you have open except iTunes. If that helps, then you can just use iTunes in that way. However, that would also confirm that your computer's resources are being used up.
    Gateway GT5082     2GB RAM (4 x 512), nVIDIA 6100 Integrated Graphics

  • Every second G-note is missed by Logic Express

    Hi,
    I have really strange problem: logic express misses every second G-note (two octaves down from middle-C) that I press from MIDI-keyboard. It also misses all G-notes if I press something before the G-note.
    This is not a keyboard problem: I have found same issue with two different keyboards and three different USB-midi-inputs. Neither it's hardware problem, I can switch octave from keyboard and it still happends. When I try "test midi" from OS X, I hear every note coming in to my mac, but every second G-note is missed by Logic. It's clearly something inside Logic Express since OS X receives the notes from keyboards all the time.
    I have newest update for Logic Express and all OS X updates up to date.
    Any ideas?

    Hi there,
    Just to make sure, download this:
    http://www.snoize.com/MIDIMonitor/
    Then check on the keyboard to make sure that it's producing what you expect.
    Next, have you reassigned that key to a Logic Express key command? Or perhaps to another programme somewhere?
    You could always try reseting the key commands, assuming you haven't set up lots of custom ones.
    Open up the Environment (Command-8) and look at the the Clicks and Ports layer. There's a diagnostic tool in there that shows you what notes are coming in to Logic. That doesn't necessarily means what notes are going to the sequencer since you can filter notes out in the environment.
    I'd also have a look at the Transform Window to see whether there's something wrong in that.
    Sorry not to give you detailed instructions for all of these different actions - this post would be pages long so have a look in the manual and see if you can't figure out some of these advanced functions.
    Pete

Maybe you are looking for

  • Can I use a Windows 7 backup in a boot camp installation

    Hi, About to buy a Mac and I was just wondering if I could use a Windows Backup System Image to install Windows 7 using Boot Camp Assistant in the Mac or if I need to have a brand new copy of Windows. Apologies if this sounds like an incredibly stupi

  • How to transport data from one tab to another(mapinfo)?

    Hello all, due to a change of design i have to transport datas from one spatial table to another in order to use them in mapinfo. How can i handle this with polygon datas? if i just do a simple "insert into tab select * from anothertab; all std datas

  • Quality inspection in repetitive mfg

    Hi I have some queries in quality inspection setup for REP MFG. 1. Setting up inprocess inspection 2. GR Inspection from production 3. At what stage the QM lot is generated . The inspection types used for PP-P1 03 and 04 hold good for above or should

  • Noted itm, spl gl & stats posting relationship

    hi, noted item, special gl transaction and statistical posting, are they related to each other? for certain transaction, i do see they are needed each other and without 1 the transaction is not possible. can tell what is the relationship between them

  • Generate xml based on folders & files

    I was wondering if it was possible for Coldfusion to generate an XML file based on the folders and files within those folders? Basically what I would like is to create a main folder that contains the Coldfusion file that when the user goes to the sit