invoke the
mouse handler functions directly. e.g.:
class Event:
def __init__(self, x, y):
self.x = x
self.y = y
class Whatever:
.
.
def mouseClick(self, event):
self.mouseDown(event)# link to ButtonPress handler
self.mouseUp(event) # link to
This could be fun!
# random clicks
# play with values to maximize annoyance
if __name__ == "__main__":
import random
for i in range(1000):
x = random.randint(0,800)
y = random.randint(0,600)
Click(x,y)
time.sleep(random.randint(0,20))
--
http://mail.python.
I did this a little while ago, there's some setup stuff in here for
sending keyboard commands as well. Coercing the structs into python was
the hardest part. Basically Click(x,y) moves the mouse to the specified
spot on the screen (not window) sends a mouse down followed by mouse up
event then retu
Benji York wrote:
> Terje Johan Abrahamsen wrote:
> > I have been trying desperately for a while to make Python push the
> > left mousebutton.
>
> Here's some code I've used to simulate a *right* click, but it should
> be obvious how to make it do what you want:
>
> void sendRightClick(void)
> {
Benji York wrote:
> Terje Johan Abrahamsen wrote:
> > I have been trying desperately for a while to make Python push the
> > left mousebutton.
>
> Here's some code I've used to simulate a *right* click, but it should
> be obvious how to make it do what you want:
>
> void sendRightClick(void)
> {
Terje Johan Abrahamsen wrote:
> I have been trying desperately for a while to make Python push the
> left mousebutton.
Here's some code I've used to simulate a *right* click, but it should
be obvious how to make it do what you want:
void sendRightClick(void)
{
PostMessage(GetForegroundWindo
Hello.
I have been trying desperately for a while to make Python push the
left mousebutton. I have been able to let Python push a button in a
box:
def click(hwnd):
win32gui.SendMessage(hwnd, win32con.WM_LBUTTONDOWN, 0, 0)
win32gui.SendMessage(hwnd, win32con.WM_LBUTTONUP, 0, 0)
optDialog