Just a simple question: is there any chance to detect mouse click
event on the whole screen, without a full-screen window?
I think it's impossible, but I'd like to be contradicted.
Try wx.Window.CaptureMouse()
-Chris
···
On 4/5/11 6:32 AM, andrea console wrote:
Just a simple question: is there any chance to detect mouse click
event on the whole screen, without a full-screen window?
I think it's impossible, but I'd like to be contradicted.
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker@noaa.gov
Your window can do a CaptureMouse and then it will receive all mouse events until ReleaseMouse is called, or the capture is stolen by another window. The mouse position in the events will be relative to the window, not the screen, but they are easy to convert.
···
On 4/5/11 6:32 AM, andrea console wrote:
Just a simple question: is there any chance to detect mouse click
event on the whole screen, without a full-screen window?
I think it's impossible, but I'd like to be contradicted.
--
Robin Dunn
Software Craftsman
ah, ok, thanks! but "capture" events means that other controls of
other windows don't receive mouse event anymore? It would be annoyng..
···
2011/4/5 Robin Dunn <robin@alldunn.com>:
On 4/5/11 6:32 AM, andrea console wrote:
Just a simple question: is there any chance to detect mouse click
event on the whole screen, without a full-screen window?
I think it's impossible, but I'd like to be contradicted.Your window can do a CaptureMouse and then it will receive all mouse events
until ReleaseMouse is called, or the capture is stolen by another window.
The mouse position in the events will be relative to the window, not the
screen, but they are easy to convert.--
Robin Dunn
Software Craftsman
http://wxPython.org--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en
andrea console wrote:
ah, ok, thanks! but "capture" events means that other controls of
other windows don't receive mouse event anymore? It would be annoyng..
Well then, I guess you need to explain a little more what you are
after. Mouse capture redirects all mouse activity to a single window,
regardless of where they occur on the desktop. It's commonly used when
you click a button, for example, so that the button always knows when
the mouse was released.
If you want to monitor mouse movements system-wide while still allowing
applications to operate, then you need a Windows hook, which lets you
monitor window messages. That requires a DLL, which can't be done in
straight Python, but there are extensions that let it happen. Google
should help.
···
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
andrea console wrote:
ah, ok, thanks! but "capture" events means that other controls of
other windows don't receive mouse event anymore? It would be annoyng..Well then, I guess you need to explain a little more what you are
after. Mouse capture redirects all mouse activity to a single window,
regardless of where they occur on the desktop. It's commonly used when
you click a button, for example, so that the button always knows when
the mouse was released.If you want to monitor mouse movements system-wide while still allowing
applications to operate, then you need a Windows hook, which lets you
monitor window messages. That requires a DLL, which can't be done in
straight Python, but there are extensions that let it happen. Google
should help.--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
mmm so I loose portability, right?
I'd like to know when the user clicks (left or right click) in a
particular region of the screen that is not my window (however I have
the coordinates of the region), but I don't want the user to notice
this. My actual solution is a transparent window in that region, but
you can imagine it's not a very good solution since it obviously
blocks controls under it (fortunately there should be no controls
there, but I cannot swear it...)