[python-win32] mouse cursor coordinates

Jacob Kruger jacobk at mailzone.co.za
Fri Feb 3 20:09:03 CET 2012


Thanks.

What primarily meant is wondered if an app would only be able to get hold of 
mouse cursor coordinates if mouse cursor was over parts of it's interface, 
or would it still be able to get real coordinates, as opposed to relative 
coordinates even if the mouse moved out off it's interface/window, etc.?

This is partly since another VI guy was asking me about a way to in fact 
sort of track mouse cursor movement over other parts of the operating system 
as such, since while you can do certain similar things using various screen 
reader software packages, they're not exactly what he was looking for, and 
this also makes me again wonder, related to second part of question, how 
possible would it be to do something like get the app to run off somewhere 
like the system tray, but still catch certain keystrokes?

Alternatively, I suppose it could just run in background, but not 
hidden/minimised as such, but don't think that would help it catch certain 
keystroke combinations as such.

Sorry if these are silly questions...<smile>

Stay well

Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'

----- Original Message ----- 
From: "Tim Roberts" <timr at probo.com>
To: "Python-Win32 List" <python-win32 at python.org>
Sent: Friday, February 03, 2012 8:22 PM
Subject: Re: [python-win32] mouse cursor coordinates


> Jacob Kruger wrote:
>> Wondering off-hand if there's a simple/easy way to obtain mouse cursor
>> coordinates, and, also, how simple is it to interact with operating
>> system, in terms of if the mouse cursor is in fact outside the GUI as
>> such - if that makes sense?
>
> win32gui.GetCursorPos will return the current mouse position in screen
> coordinates.
>
> Your second question is not clear to me.  An application does not
> receive mouse messages when the mouse goes outside its window, unless it
> is using "mouse capture".  If you click on a button control and hold the
> mouse button down, then drag the mouse outside the button, you'll notice
> that the button window stays depressed until you release the mouse.
> That happens because the button control "captures the mouse".  All mouse
> messages are directed only to the button until it releases capture,
> which it will do when the mouse button is released.
>
> Beyond that, you'll have to ask a more specific question.
>
> -- 
> Tim Roberts, timr at probo.com
> Providenza & Boekelheide, Inc.
>
> _______________________________________________
> python-win32 mailing list
> python-win32 at python.org
> http://mail.python.org/mailman/listinfo/python-win32 



More information about the python-win32 mailing list