5

I have an application that needs the user to enter the x and y location of a couple of items on the screen. [Yes, this is crap and I'll replace it, but for now...]

On Mac OS X, I'm using Snapz Pro X. When I choose to take a snap of a selection, the interface displays the mouse cursor location. This is OK for my personal use, but I can't ask users to buy a $69 program for this function.

I thought I had a solution with the built-in program "Grab", but it reports the coordinates from the bottom left, and I need it from the top left.

I don't have access to Windows; not sure what to use there. I've not even been able to come up with good search terms since mouse and coordinates and x/y are so common. Ideas are welcome there. Extra credit: same x/y finder for Linux. A Java program would be OK too, since the main application is in Java.

  • ACK! I've asked 4 questions in 1 (platform.each). But it would have seemed dumb to ask a separate question for each platform. Hm. – slothbear Dec 21 '09 at 5:05
  • The answers you folks posted helped me refine my search terms -- so I was able to find some more answers. Much appreciated! – slothbear Dec 24 '09 at 4:02
  • Uhm. Snapz Pro X has a 15-day free trial. After that, it watermarks the screen captures. And you don't even want the actual screen capture. Unless you think that's abusing the free trial. It's a great program; maybe they'll get hooked and buy it. – slothbear Dec 24 '09 at 4:09
  • I might as well be my own sock puppet at this point. – slothbear Dec 24 '09 at 4:09
  • See also Program for getting the cursor's x,y coordinates? with another suggestion for Windows. – slothbear Dec 25 '12 at 4:45

11 Answers 11

4

For Windows you can use Point Position :

The way to use the application is very simple:

  • Move the window by putting your mouse cursor in the cross which is in the middle of it, and point one of the four corner arrows into the place of the screen you want to define.
  • Then push the button corresponding to the pointing arrow.
  • The text entries will take the color of the button, and they will show you the exact pointing position.

image

  • feel free to upvote my recommendation :) – Molly7244 Dec 20 '09 at 21:19
  • I'll just upvote both of you, though merging answers like this would be better! – Ivo Flipse Dec 21 '09 at 12:07
3

Point Position (for Windows) is a simple tool that lets you pick the coordinates for any point on your screen (using X,Y axis). Simply point one of the four corner arrows at the spot on your screen that you want to define and click the button to display the X/Y coordinates.

Point Position is freeware.

  • Upvote done. Isn't my recommendation beautiful, image and all? Would be a great pity to delete it :) – harrymc Dec 20 '09 at 21:35
  • I'll just upvote both of you, though merging answers like this would be better! – Ivo Flipse Dec 21 '09 at 12:06
  • @Ivo: No problem. We also upvoted each other. – harrymc Dec 21 '09 at 12:42
  • @Molly: It seems like the image carried the day. My apologies. – harrymc Dec 23 '09 at 14:25
  • 1
    "Sorry! This program is no longer available for download from our site. It may have been discontinued or become obsolete." – AXO Dec 4 '15 at 1:13
3

For Macintosh, use the built-in screen capture function. Press Command-Shift-4 to take a picture of part of the screen. The cursor switches to a crosshairs cursor that includes the x/y screen coordinates. Press ESC to cancel the operation

  • 1
    That works, but it's kind of tough to use in practice. The screen continues to update under the cursor (popups and junk in this case), plus the x/y numbers have poor contrasting colors and they're tiny. It sounds better to use the Grab program -- and teach them how to subtract the Y value from their screen height. You already have an ugly UI, what's one subtraction? – slothbear Dec 24 '09 at 4:12
2

I used Cursor Position from CNET.com:

From Mattlav Software: Cursor Position allows you to work out the exact X and Y position of your cursor even as you move it, it also tells you how many pixels you have gone across if you move the cursor with the application open.

  • Can you provide some details as to how the application solves the question? thanks. – suspectus Aug 26 '15 at 7:27
  • I edited the question – xcvbn Aug 26 '15 at 8:10
  • That looks much better now. – suspectus Aug 26 '15 at 8:32
  • Nice app! Runs on Windows (not a dig, just noting since I included all platforms in the question). – slothbear Aug 26 '15 at 15:21
1

I was led to this page through a query of my own. I had a further search around and found xev (on Linux and Mac OS X.)

Here's the Mac OS X documentation: http://developer.apple.com/Mac/library/documentation/Darwin/Reference/ManPages/man1/xev.1.html

The Bash commands

$ root=`xwininfo -root | grep xwininfo | sed 's/.*0x/0x/; s/ .*//'`

$ xev -id $root

provided me with the information required. :)

  • It is important to know that on OS X, the xev command requires installation of X11. This is an optional installation on later OS X systems. – slothbear Dec 25 '12 at 4:41
1

For Mac OS X, xScope is pretty good. Turn on the Loupe (magnify) tool to make it easier to see exactly where you are. Then use the Crosshair tool to locate the exact spot you need.

If you'd like to measure your spot from a place that is not relative to the screen origin, move the cursor to your local 0,0, then press Command-0 to set that spot as 0,0.

xScope is a commercial product from The iconfactory. The app shows up in bundles regularly. But it must be worthwhile. Heck, the latest version boasts

70+ new features

  • Sockpuppet!!!!! – slothbear Jan 9 '14 at 0:34
1

One way to do it is install Python and pyautogui for Python.

  1. Make a file mousepos.py
  2. Place the following in the file and save it.
import pyautogui
pyautogui.displayMousePosition()

It does everything you asked for.

  • This looked at first like a really good and simple solution but it only works for one monitor. Multiple monitors are not supported – Hakaishin Nov 12 '18 at 20:21
0

For Java, you can use the PointerInfo class, introduced in Java 1.5.

import java.awt.MouseInfo;
import java.awt.Point;

public class Portia {
     public static void main(String args[]) throws InterruptedException {
        Thread.sleep(10000);  // some time for user to position mouse
        Point spot = MouseInfo.getPointerInfo().getLocation();
        System.out.println(
                String.valueOf(spot.getX())
                +","+
                String.valueOf(spot.getY()));
     }
}
0

Skitch from Evernote includes an x/y coordinate display while taking a screen snap. The numbers are small and don't have any contrast layer -- so they're hard to see on a black background. Skitch is currently free.

enter image description here

0

Quix App is a browser bookmarklet: cross-platform, no plug-ins.

Drag the bookmarklet to your bookmarks toolbar. Click. Enter the command ruler, and you get a nice cross-hairs cursor to work with, and an informative pop-up with all the coordinates.

alt text

0

If you're using the Chrome browser, there is a well-maintained extension called coordinates. It shows coordinates for the page, the screen, and can measure an area by dragging.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.