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.

link|improve this question
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
feedback

6 Answers

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.

link|improve this answer
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
Image was helpful, but since the answers were essentially the same, I accepted the one with lower reputation. Not sure why that would matter with reps in the Ks though. – slothbear Dec 24 '09 at 4:06
feedback

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

link|improve this answer
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
feedback

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. :)

link|improve this answer
feedback

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

link|improve this answer
feel free to upvote my recommendation :) – Molly7244 Dec 20 '09 at 21:19
+1 i do like the picture, very cute :) – Molly7244 Dec 20 '09 at 21:51
I'll just upvote both of you, though merging answers like this would be better! – Ivo Flipse Dec 21 '09 at 12:07
feedback

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()));
     }
}
link|improve this answer
feedback
up vote 0 down vote accepted

Quix App is a browser bookmarklet: cross-platform, no installation, 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

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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