Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4009555

RFE: API to location of mouse on desktop

XMLWordPrintable

    • tiger
    • generic, x86, sparc
    • generic, solaris_2.5, solaris_7, windows_nt

      Applix has requested an API to return the location of the mouse on the desktop. They would use this to place windows at the mouse location.

      =============================================================
      Another report:

      I would like to obtain the current mouse location without waiting for any events.

      I'm looking for something simple, like:

      public class java.awt.Mouse
      {
        /**
         * @return A Point representing the mouse's current X and Y coordinates.
         */
        public static native Point getCurrentPosition();
      }

      An example of why this is useful is:
      1/ Load up Netscape
      2/ Go to a really long page that has lots of URLs
      3/ Click anywhere on the page that isn't over an URL
      4/ Let go of the mouse; don't ever touch it
      5/ Use the cursor keys (Up Arrow, Down Arrow, etc.) to scroll the long
         page up and down
      6/ Watch the mouse cursor change as an URL scrolls behind the mouse cursor
         (again, without so much as breathing on the mouse)

      In order for Netscape to change the shape of the mouse cursor, it needs
      to know if the mouse's current location on the screen is over an URL or
      not. To do this, whenever you scroll the page with the cursor keys
      (which are far from being a Mouse Event), Netscape must query to see
      where the mouse is currently situated on the screen. If that location is
      on top of an URL, it changes the mouse shape to a Hand Pointer, or some
      such thing.

      brian.klock@eng 1997-11-12
      =============================================================

            sdasunw Sda Sda (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: