Tracking Mouse X,Y w/o mouseListener

I am writing a program where you draw with a paintbrush, you begin a stroke by clicking, you end a stroke by releasing. This was easily taken care of by a simple mouseListener. However I want to track everywhere the mouse goes while the mouse is clicking. This way you could draw squigley lines and things with curves rather than just a straight line connecting click location with release location. Unfortunately I have no clue how to get a mouse's X,Y coordinates besides a mouseEvent. Obviously that can't be called without clicking or releasing so I need some help finding out what to do.

Point p = java.awt.MouseInfo.getPointerInfo().getLocation();
          System.out.println(p.getX() + "  " +  p.getY());

Similar Messages

  • How do I right click on my track mouse?

    How do I execute a right click on my MacBook Pro track mouse?

    Tap on the surface with 2 fingers.
    Have you switched all of the options that you want to use on?
    In System Preferences>Trackpad.

  • Keyboard Issues Intermittent Use of Keys & Tracker Mouse

    Hello All,
    Look forward to some help please.
    Not sure what is wrong, seems there are a number of weridy things going on. Nothing dramatic, but all very annoying.
    About a month ago replaced the HD myself, re-installed, everything seemed fine. Then had the following problems.
    1 - 'U, J, M' keys stopped working. After PRAM zap were ok.
    2 - At a later date the directional 'up & right' keys and the 'Return' stopped working, no explanation just sometimes works with a restart or a complete power down and reboot.
    3 - Tracker pad stops working completely then plug in a PC USB mouse and might start working again, might not.
    4 - Screen goes black and I have to press the power button to get the machine up again. This is with the power cable plugged in and power on.
    I appreciate this machine is oldish but these are strange enough problems, with no consistent reasons for happening that I can think of.
    Lastly I got the following message when it went completely south on me.
    I'd appreciate any help possible, other forums have not been able to even post a response. Many thanks again.
    This morning I had points 2 & 4 happening and had to power down reboot.
    Mike
    ----Error Report------
    panic(cpu 0 caller 0x0007D054): need corner case for fictitious page
    Latest stack backtrace for cpu 0:
    Backtrace:
    0x000954F8 0x00095A10 0x00026898 0x0007D054 0x0028B7B8 0x000DF7FC 0x000DC29C 0x000DC528
    0x000DE864 0x000DE2C0 0x00229FD4 0x000FC538 0x000F57E8 0x0027F304 0x0027F010 0x002ABDB8
    0x000ABD30 0x696E673E
    Proceeding back via exception chain:
    Exception state (sv=0x42977A00)
    PC=0x9004B48C; MSR=0x0000F030; DAR=0xE0284000; DSISR=0x42000000; LR=0x90BCA0A0; R1=0xF071D360; XCP=0x00000030 (0xC00 - System call)
    Kernel version:
    Darwin Kernel Version 8.11.0: Wed Oct 10 18:26:00 PDT 2007; root:xnu-792.24.17~1/RELEASE_PPCModel: PowerBook5,3, BootROM 4.7.0f2, 1 processors, PowerPC G4 (1.1), 1.33 GHz, 2 GB
    Graphics: ATI Mobility Radeon 9600, ATY,RV350M10, AGP, 64 MB
    Memory Module: SODIMM0/J20STANDARD, 1 GB, DDR SDRAM, PC2700U-30330
    Memory Module: SODIMM1/J23REVERSED, 1 GB, DDR SDRAM, PC2700U-30330
    AirPort: AirPort Extreme, 405.1 (3.90.34.0.p18)
    Modem: LastDash, UCJ, V.92, 4.0, APPLE VERSION 2.6.6
    Bluetooth: Version 1.9.5f4, 2 service, 1 devices, 1 incoming serial ports
    Network Service: AirPort, AirPort, en1
    PCI Card: TXN,PCIXXXX-00, cardbus, PC Card
    Parallel ATA Device: MATSHITADVD-R UJ-816
    Parallel ATA Device: WDC WD1200BEVE-00WZT0, 111.79 GB
    USB Device: Bluetooth USB Host Controller, Apple, Inc., Up to 12 Mb/sec, 500 mA

    Mike:
    Welcome to Apple Discussions.
    Your, apparently, random keyboard issues may be due to either faulty connection of the keyboard ribbon cable to the logic board, or a defective/damaged ribbon cable. I suggest you go back in and make sure the connection of the ribbon cable to the logic board is secure. If necessary place a new piece of kapton tape on it to secure it.
    I further suggest that you boot the computer from the Apple Hardware Test disk that came with your computer, and run the extended tests in a loop (hold down Ctrl + L during tests) and let is run for a while, as intermittent issues may take up to several hours to show up.
    cornelius

  • Track/Mouse Pad Issue

    My MacBook has been sitting on my desk for two days....suddenly, the only way I can do a "mouse click" is by tapping the track pad, not by pushing the lower left or right corners. The pad itself at the bottom where the push click would be is actually (for lack of better word) lower than the top and I can no longer actually "click" when I push the lower corners.
    So, two questions...
    1.) Is this a common problem?
    2.) Is this fixable or am I stuck with a wireless mouse for the rest of the computer's life?

    Hi and welcome to Apple discussions,
    Is your Macbook one with a removable battery. If it is take the battery out and run it from the mains. Does the track pad work OK now. If it does it probably means that the battery has become distorted or swollen and is affecting the trackpad.
    It may be time to get a new battery.
    Regards from England,
    Alan

  • Track mouse position in Bookmark window.

    When the cursor moves to a bookmark window, it underlines the bookmark title and shape of the cursor also changes(say finger shape).
    Is there any callback function/some other way to track the change in cursor position when it is in Bookmark window,(means when it is moved to that window and moves over a bookmark) please tell me.
    thank you,
    palaksha

    No, there are no provided APIs to give you that level of information.
    Leonard

  • Tracking mouse over 3d member

    please, i `m trying show information beside to mouse pointer
    in a effect of roll over, bad a haved a promblem with overlaping of
    sprites, the text sprite aways appear back to 3d sprite, and i need
    that the text apear over the 3d members trackin the mouse
    moviment.

    You might have the 3D sprite DirectToStage property set for
    better
    rendering speed, the DirectToStage (DTS) property of the 3D
    member must
    be uchecked to enable other sprites to float above it (lingo
    can toggle
    this on te fly)
    An alternative is to make the text an objectt within the 3D
    model.

  • Pencil mouse as opposed to track mouse?

    I have been having a lot of problems with stressed muscles due to the use of my regular mouse. i am in the market for a new mouse. I was wondering if anyone has used the pencil mouse and what you think about it?

    There are some reviews about the few pen-like mouse products available, online.
    Ones I'd noticed were from a year or two ago, hard to say if they were a hit or not.
    https://www.google.com/?gws_rd=ssl#q=stylus+mouse
    Some time ago, I had a rollerball that did OK, it was like a 'billiard ball' though.
    At least it did not run out of desktop space and never ran into anything nearby.
    For persons who get tired fingers from writing by hand (remember that?) these
    stylus mouse pen mouse products could still lead to that kind of effect, even if
    you don't mind writing with a large marking pen effect; or a giant kids crayon.
    One of the cordless wireless pen mouse products had a customer followup review
    and they suggested buying a big box of batteries (AAs) as it used a battery a week.
    They did not allude to the kind or type of battery recommended, as there are some
    that should last longer than a week; but they cost more. The unit in question did not
    appear to use re-chargeable batteries; but they may if correct voltage is available.
    And then, there are styli and tablet models; these are generally finer than pen mouse
    and may be an alternative to a mouse, to give your hands a break, if it'd work for you.
    Perhaps a step above an iPad and a finger, for freehand, with less of a crayon effect.
    There are a few items I'd noticed in the search result link above; Genius Pen mouse,
    the G-stick mouse, and others that are either stylus/tablet or a styli for iPad, etc. I'd
    seen some good things done with the tablet idea, mostly detailed quality renderings.
    Hopefully you can find something from somewhare that has a fair return policy so you
    can give it a few days test drive. Or a few hundred hours with some gallons of coffee.
    In any event...
    Good luck & happy computing!

  • FROZEN TRACK-MOUSE

    every so often my MBP trackpad Mouse just freezes up & I can't do anything, the only way I can get going again is to completely shutdown then restart.
    Is there a solution to this??
    Thanks in advance for any & all help.

    I had the same problem and it was due to the already documented battery problem that starts to expand and puts pressure on the trackpad, so verify the state of your battery and remove it to see if the problem goes away, also if the battery is faulty use the free replacement policy that apple issued for this type of problem

  • Magic Mouse Tracking Question

    I'm on my second Magic Mouse. Returned the first because the tracking was really bad. This second is better, but not as good as my old Mighty Mouse.
    I've noticed that the Mighty has a red light next to the optical sensor and the Magic doesn't have this. Wondering if this might be a cause for the worse tracking. Is it true that the Magic Mouse does not have that red light that the Mighty had???
    I'm digging the Magic Mouse but not sure what to do if I can't find a way to improve the tracking.

    My system's Magic Mouse has been acting up since I got the machine as well. My old wireless Mighty Mouse is fine. After doing some researching online and testing of my own, it would seem that there are two causes.
    1) Magic Mouse transmitter placement and power level are less than optimal. Maybe the multi-touch surface results in a poorer signal, maybe it's just not as powerful as the Wireless Mighty Mouse, but the result is the same.
    2) Mac Pro bluetooth antenna placement doesn't afford the best possible reception, especially on machines configured with wifi (since the wifi antenna may interfere with bluetooth reception).
    Individually, each of the two are very minor issues. However, combine the two and you get poor reception and tracking (mouse appears to skip across the screen or lose signal for periods of time). In some cases, simply moving the machine can reduce or eliminate the problem (even only a few inches). In others, I've seen DIY solutions ranging from going inside the machine and moving the antenna to rigging up an external antenna wire. Still others have suggested getting an inexpensive bluetooth dongle (available from a lot of outlets online for under $20) and plugging it into the Mac Pro.
    Dongle's (inexpensive Belkin adapter) been working well for me, I've had no signal or tracking issues since.

  • Touch screen mouse clicks

    Hi, id firstly like to begin by saying i am only learning Labview at the minute so i appeal for some patience,
    I have done the relevant searchers also but i am unable to find an answer to my question.
    Ok i am using a 17.5" resistive touchscreen to track the path of a ball which is placed on the screen..I want the screen to communicate the x-y co-ordinates to an x-y graph on the front panel of my program. In my attemp at doing this i have used a previous labview example which uses a mouse click event structure. However this means the touchscreen acts as a second mouse. My problem is that the touchscreen is not communicating with the graph directly as it is controlling the entire pc screen meaning it can interfere with the program.
    I have included a two page word doc with screenshots which hopefully can explain better what i mean. One screen shot is the display result of the Labview program, the second resembels the path of the ball on the touch screen
    Page one of the doc shows the ball tracking when only the first quadrant of the screen is used.
    Page two of the doc shows the result when the full touchscreen is used. as the touch screen acts as a mouse it is only able to track the ball when it is in the same locating as the graph on the screen.
    I have found it difficult to explain my problem but i hope you gurus can understand and provide me with a solution!
    I am hoping someone can give me an answer that will allow the touchscreen to communicate with the labview x-y graph only.
    Thanks in advance for any help.
    Attachments:
    Doc1.docx ‏277 KB

    Please do not embed screenshots inside of Word documents. Not everybody has Word, and even if they do, most people don't like using Word 2007+. Attach the screenshots as PNG files. DO NOT ATTACH BITMAPS OR CHANGE THE EXTENSION OF BITMAPS TO GET AROUND THE BAN ON BITMAPS. Don't worry I'm not screaming specifically at you. It's just my normal scream sentence.
    As for your issue, there's a couple of things that are unclear from your description. Before offering a solution it's better to understand the objective here. The example you are using was specifically designed to only track mouse movements over the graph. However, your description seems to imply that you want to draw on the graph regardless of where the mouse is on the screen. Is this correct? If so, then you need to use the Input Device Control VIs to poll the position of the mouse, as that returns the mouse coordinates globally (search the examples for "mouse" and look at the "Basic Input Demo" example). Second, why an XY graph? Are you drawing a bouncing ball over some graphs? I would think you'd want to use the picture control.

  • Windows 8 Mouse and Touch Events

    Came accross this issue where AIR runtime 3.8 (and 3.9 beta) on Windows 8 do not track mouse events correctly. Rolling back to 3.7, and publishing to 3.7 is the only way to have existing content work correctly when using a touchscreen.
    This also effects GestureWorks projects. TAP events are dispatched but SCALE, DRAG and ROTATE are not.
    Everything works perfect on 3.7 on Windows 8. 3.8 works perfect on Windows 7. But no 3.8 on Windows 8.
    I think this is a massive issue.
    Bug Report Created - https://bugbase.adobe.com/index.cfm?event=bug&id=3635216

    First, the rumor is that touch on the W540 will be available H1, but not earlier. If you look at Dell's M3800 with touch, they have delays until mid-March with their Retina touch panels, so it'll take a while for the W540 to be available with touch. It is also possible that the W540 won't be available with touch until Intel's Haswell refresh comes out, but who knows.
    Second, if you install the Windows 8.1 upgrade, please take care to check the "Brick your W540" thread, as there is something wrong with the bios and Intel Rapid Start-up Technology. It may result in your motherboard's failure, so disable RST before doing so.

  • Mouse Right Click

    Hello all,
    How to track mouse right click in Oracle Forms? I have a form which has a popup menu, based on the item status i have to enable and disable some options in the popup menu. Any ideas?
    With Regards,
    Yathish

    try the PRE-POPUP-MENU - trigger

  • Random disappearing of scenes and strange behavior of mouse.

    I am modelling a school project and I have included a number of images and sounds in every scene of my 10 scene project. These have behaviours associated with them, which could for example be 'go to frame' etc.
    When I finally publish my project, some of these images dissapear randomly and sometimes clicking at any spot takes it another scene (which is not how it is modelled to behave). Could anyone please help me with any solution of how to fix this.
    Also while using sprite track mouse behaviour, button clicks are not reponsive any more. Does this behaviour prevent the mouse from being able to click the button?
    Thank you!

    You may need to have this frame script in the final frame of each scene:
    on exitFrame me
    go the frame
    end
    Otherwise the playhead will pass  that frame and go to the next marker automatically.
    Also, if you do have that frame script in place, if sprites do not extend to that frame, they will vanish as the playhead passes the last frame of the sprite.
    Using mouse trails does seem to disable clicking for buttons that are Flash components. "Classic" buttons seem to be unaffected.
    Upon testing: if you are using the Flash component buttons, set the eventPassMode to #passAlways. You can change this setting using lingo. Example:
    sprite(x).eventPassMode = #passAlways
    Substitute the "x" above with your specific sprite reference, either the sprite channel number or the name of the sprite, such as
    sprite("myButton").eventPassMode = #passAlways
    With the eventPassMode set to #passAlways, the Flash component buttons remain clickable.

  • Run tool.. and stop on mouse and keyboard movements!!

    Hello frnds,
    I would like to share a problem with all of you..!!.. and need some advice!!
    I have a tool "optimizer" which takes a hell lot of time in optimizing images.. I have to pass some arguments to it.. (the optimizer script.. and output path).. so am writing arguments in separate file.. "sample.txt"
    I am doing it by reading contents of sample.txt and passing to optimizer.. 1 by 1
    String cmd = new String[3];
    cmd[0] = "optimizer.exe";
    cmd[1] = "Optimizer_script.txt";     //coming from sample.txt
    cmd[2] = "temp/folder";               //same
    try { Process process = Runtime.getRuntime().exec(cmd); }
    catch (IOException ex) {}Thts ok.. running fine..
    Now what i want.. once process started if user.. presses keyboard or mouse..
    the program
    1. shows an message "Optimizer is running.."
    2. does not allow user to do anything!!
    and then stop(System.exit(0);Message = "Optimzer stopped") before reading next arguments from sample.txt.. (optimizer dont read next line in sample.txt).. and again when optimizer started it runs from same line.. I can do it by marking that line..!!
    well frnds please tell me how to track mouse and keyboard actions.. whats the best way to do.. wht am trying to achieve!!.. Do I have to take care of how much time "optimizer.exe" takes.. in executing first line??.. if yes.. how to do that?
    Thanking in advance
    gervini

    If anyone wish to answer this post.. please do now at.. succeding thread..
    http://forum.java.sun.com/thread.jspa?threadID=718051&tstart=0

  • How to capturing Mouse double click action?

    Hi all,
    how can we identify the "mouse double click" action?
    MouseListener has methods for only mousePressed,released,clicked (single).
    Thanks in advance..
    Regards
    Sojan

    Hi,
    Thanks it worked ..
    e.getClickCount() value increases if we keep on clicking on the component, is there anythning wrong by interpreting double click as
    "e.getClickCount() >=2 "?
    Regards
    Sojan

Maybe you are looking for