boppreh / mouse

Hook and simulate global mouse events in pure Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mouse.move doesnt accept a list

Motzumoto opened this issue · comments

commented

Doing this:

button_left = [400, 960]
button_middle = [480, 960]
button_right = [580, 960]
button_choices = [button_left, button_middle, button_right]
mouse.move(random.choice(button_choices))

TypeError: move() missing 1 required positional argument: 'y'

Is there some other way i can do this?

mouse.move accepts x and y arguments. Have you considered doing one of the following?

choice = random.choice(button_choices)
mouse.move(choice[0], choice[1])
choice = random.choice(button_choices)
mouse.move(*choice)
choice_x, choice_y = random.choice(button_choices)
mouse.move(choice_x, choice_y)
commented

mouse.move accepts x and y arguments. Have you considered doing the following?

choice = random.choice(button_choices)
mouse.move(choice[0], choice[1])

I have not considered that, thanks!