Get mouse position outside application

Hi,
I need to know the position outside my java application, but I don't know on what I should add the MouseMotionListener. Any suggestions anyone?
I'm running Microsoft Windows..
Thanx,
Jesse

can't do that without JNI and a mouse hook.

Similar Messages

  • Getting mouse position into flash from JavaScript?

    Is there a way to get mouse coordinates in a browser that is
    cross browser compatible? I am able to track the mouse coordinates
    in all browsers except FireFox (Windows). In Windows firefox I can
    track the coordinates outside of the flash object but not inside
    the flash object. I am using the below script. Any help in this
    would be greatly appreciated. Thanks in advance.
    Regards,
    Beau

    I guess the easiest way is still to use a MouseMotionListener that you could add to your top level container. You could then store the value of the last position and still be able to access it even if the mouse hasn't moved.
    You might also want to use the following method : SwingUtilities.convertPointFromScreen(Point p, Component c);

  • Get mouse position during Custom UI Draw event?

    I am building a Custom UI for one of my plugin effect.
    I want to get the mouse position during the Custom UI Draw event (PF_Event_DRAW), but cannot manage to get it.
    From what I understand, it seems we can only get the mouse position during the events PF_Event_DRAG, PF_Event_DO_CLICK, and PF_Event_ADJUST_CURSOR.
    I tried to use PFAppSuite4::PF_GetMouse() too, but this resulted in the error message "After Effects error: internal verification failure, sorry! {PF_GetMouse can only be called during valid events.}".
    Therefore I want to store the mouse position during PF_Event_ADJUST_CURSOR, and use it later during PF_Event_DRAW.
    Where can I store those values in a "clean" way (ensuring there will not be conflicts if two instances of the same effect are running, etc)?
    Or is there an easier method to get the mouse position during a Custom UI Draw event?

    //SequenceDataVars is the name of your data structure
    //this is how you create the sequence data
    out_data->sequence_data = PF_NEW_HANDLE(sizeof(SequenceDataVars));
    SequenceDataVars *seqData =
    (SequenceDataVars*)PF_LOCK_HANDLE(out_data->sequence_data);
    //and now you can store stuff in it.
    seqData->var1 = 7;
    //after it's created, on other calls, you just do a simple cast
    SequenceDataVars *seqData = *(SequenceDataVars **)out_data->sequence_data;
    seqData->var1 = 100;
    //this is how you delete it. (if you don't delete it, it will be saved with
    the project, and loaded on the next session. (if you want)
    PF_DISPOSE_HANDLE(out_data->sequence_data);
    there's more to know, so look up SequenceSetup, SequenceSetdown, ect in the
    sample project.

  • Capture Mouse Position outside an applet

    Dear All,
    I'm working on an applet that needs to know the actual position of the mouse cursor outside its area
    (i.e.: else where on the screen), is that possible?
    Thank you in advance.

    As far as I know, no. Applets know about the mouse only when it's inside the applet area.

  • Getting mouse position without a listener

    Hi all,
    I'm trying to achieve the equivalent of Component.getMousePosition() that Sun
    so kindly put into 1.5, without forcing all my users to immediately upgrade to 1.5.
    Any ideas? Just the normal relative-to-component mouse position is all I need, but I have to get it even if the mouse hasn't moved, so there are no events.
    Thanks a lot

    I guess the easiest way is still to use a MouseMotionListener that you could add to your top level container. You could then store the value of the last position and still be able to access it even if the mouse hasn't moved.
    You might also want to use the following method : SwingUtilities.convertPointFromScreen(Point p, Component c);

  • Question re-posted: Way to get events from outside application

    Hello,
    FatCo asked this question but has not got a reply. I have the same question, so I re-post it, hoping someone could give us help. How can we write JNI code to do it on a Windows OS? Assume appliction 2 is a Internet Explorer.
    Thank you!
    --Bin
    Author: FaTCo Sep 24, 2002 1:17 PM
    Hello,
    is there a way to get events from other applications, either native or java applications?
    For example application 1 (Java or not) is getting minimized, is there a way to notice application 2 (Java) about that?

    I am not really a Windows programmer so I cannot say how you can get the event notification in C(++) but if you can get it there then there should be no particular problem communicating that information to Java.
    This might take the form of creating a thread (all threads are native threads on Windows) which blocks on receiving this event and then notifies the rest of the application somehow, maybe by setting a global flag, using Object.notify() to wake up some other thread to do the processing, or simply by calling a Java method to do all the necessary handling before returning. But there is nothing special about this part.
    It all depends on how you can receive the event notification in C++.

  • Mouse position outside of the top-most container

    I know how to acquire the position of the mouse through either the MouseListener or MouseMotionListener interfaces by calling the getX() and getY() of the MouseEvent class.
    But if the mouse is moved outside of the top-most container, eg. a JFrame, then the methods in the two listener interfaces above aren't called.
    So, does anyone know how I can retrieve the position of the mouse if it is outside the JFrame?
    Thanks,
    Dewi Williams

    As far as I know this is not possible using pure Java. Search the native methods forum for the OS(s) you are supporting and this topic.

  • Perform mouse clicks outside application

    Does anyone now hot you would tell the computer to perform a mouse click, but not on the main application? i.e. You can set the mouse cursor position easily, but can you tell the mouse to click on say an icon that is on the desktop, if the mouse cursor is over it???
    I think JNI will be involved but I don not now.
    Any hints will be a great help.
    US101

    Have you had a look at java.awt.Robot (Introduced in Java 1.3)?

  • Getting mouse events outside of nodes

    Does anyone know how to get a mouse event to trigger outside of a nodes clip area? I am trying to write a game and follow the model/viewer/controller outline. I want the controller to handle the mouse events and the controller have no substance on the screen. Mouse events only seen to work when they are inside a node. My current fix is to make the controller appear on the screen as a giant rectangle of the background color. However if there is a better way I would appreciate it.

    My current fix is to make the controller appear on the screen as a giant rectangle of the background color.That's indeed the classical and recommended way. Or make it transparent. Can be in the background (let the nodes handle the clicks (they can block mouse or not), get all "lost" clicks) or in the foreground (get all clicks, letting them pass through to be handled also by nodes).

  • Mouse-events outside application

    Dear sir,
    >
    Please can you help me,
    I want my java containers wthin my java-application to listen to mouclickevents outside my java-application (so I can close some windows)
    Is this possible?
    Hope you can help me

    The best I can think of is to use the Robot Class in Java 1.3 or later. I am not sure this is what you are looking for though.

  • Can i get mouse location and event outside JFrame?

    Can i get mouse location and event outside JFrame?
    any related link or document? thx~

    what I figure out from your question is that, you want to get the coordinates even if the mouse is not directly interacting with any of the java components of your application.
    I would consider this as an interaction with the OS so that it sends a call to your java program as well when ever the mouse event occurs. If you use JNI to catch system events, I think it should work.

  • DnD - Get Drop Mouse Position

    I want to Drag some image file from a JList, and then drop it on a JPanel. The dropping on the panel functions. The problem is, i would like to get the position of the mouse, when the item is dropped on the panel. I use the panel to visualize graphics with Graphics2D, and the image dragged from the list should then be displayed at the position on the panel, where it is dropped. So how could i get this position? I have added a MouseListener to the panel, but it does not react on the mouse events which are caused by the DnD action.

    I am really helpless... Is this a stupid question or does nobody know the answer?
    I just want to get the mouse position of the drop, after a drag and drop.
    I found a MouseDragGestureRecognizer Class, but i am not able to implement. Actually i have just a JList, from which Strings are dragged, and a JPanel, on which the Strings are dropped.
    The drag and dropping functions, but i need the mouse position on the JPanel, when the String is dropped.

  • Get Current Mouse Position

    Is there a way to get the current mouse position on the screen? Unfortunately, I cannot use a listener to provide the mouse position, because I don't know what components (if any) that the mouse is over. I am trying to draw in the glass pane during a drag and drop. During a drag and drop, the glass pane does not get mouseEntered or mouseMoved events (which I would have used to get the ouse position if I could). So I was hoping for a static method that I could use within the glass pane's paint method to give me the current absolute position of the mouse.

    a time ago i used the glasspane and the mousemotionlistener works perfect. you only should be sure to show ( setVisible(true) ) your glasspane. the best way is to look onto the java tutorial how they did it.
    link: http://java.sun.com/docs/books/tutorial/uiswing/components/rootpane.html
    tobais

  • [JS] Get Mouse Cursor Position

    I have looked through the documentation and forums here and haven't found any reference to getting the cursor mouse position. I see info about text cursor position, but I am looking to capture the coordinates of mouse position. Is that possible with JavaScript (ExtendScript)?
    Thanks for any help you can offer.
    Dan

    I want the script to create a specific sized picture frame on the page. It would be cool to make it at the current mouse position. Yes I can draw the frame myself, but I am trying to automate a tedious process, so having the script create the frame with all the proper options such as size and style will speed things up. I can create it in the middle of the page with the script, and then drag it into position manually, but it would be even better to use the mouse position when the script creates the frame.
    Maybe an AppleScript could get the mouse position?
    But then how would I pass that to my JavaScript?

  • Get mouse cursor position

    hello,
    how can i get the position of the mousecursor (in x, y coords relative to the complete screen) if its not invoked by a mouse event (else its easy with event.getX / Y ())?
    cu,
    cpio

    maybe u can get yur cursor position wif a ruler? dun b dumb. u cant get the xypos anyother way. But ofcos if u like the hard way, u can always use another app to capture the mouse positon n let it inform yur main Java app, thru local ports or even use JNI. N i dun c y anyone will wan to do it this way. it oready defeats the purpose of using Java.

Maybe you are looking for

  • How do i set up a second ipod touch on my computer?

    I have an I tunes account, which I set up for my son, I have now purchased an I pod for my daughter and wish to use both on the same computer. I have created an account on the computer for my daughter, but, i am struggling to fathem how to keep the d

  • Procurement type in mm60

    Hello guys.. Is it possible to add procurement type in mm60 report(output). like in mb51,MSEG table is used and you can add fields for output from mseg ..                     spro->mat mgmt>inv phy invt->reporting--->field selection for material docu

  • Adobe Media Player downloads videos then deletes them??

    I'd like to note that Adobe Media Player continues to maintain that video files are downloaded for offline viewing. However, the application then 'deletes' those files from the cache at some time in the future, usually an hour or so after downloading

  • 10.4.8 - CPU usage

    This was noted on another Forum on another site and its only then I noticed it, so for what its worth - Anyone experiencing (on a plugged in unit) that since the upgrade, your MacBook is running its CPU at max? I have a base MacBook and pre-upgrade -

  • How to limit background job's numbers of end-users

    Dears, Users always need run many Background Jobs at the day,but I heard other company almost only allow users run Background Jobs at the night. Generally, how many background jobs running on one Instance is normal? Do we have any good ways to contro