[python-win32] mouse cursor coordinates
Jacob Kruger
jacobk at mailzone.co.za
Fri Feb 3 20:43:30 CET 2012
Ok, just tested it using win32gui.GetCursorPos function, and it does seem to
obtain coordinates outside primary window as well, so let's see - thanks.
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