Gökay Kara
Gökay Kara

Reputation: 11

python mouse click and mousemove

I want to do auto mouse move and auto click, but it will be invisible, it will run in the background. It will keep clicking on a fixed location in the background game while I do other things on the computer. is it possible? will someone help me?

Upvotes: 0

Views: 1381

Answers (2)

TheEagle
TheEagle

Reputation: 5992

What you are trying is impossible, at least in Python. While you can create a synthetic second mouse and click a fixed location with it from Python as @Sinr Ego explained, this click will always happen in the window that is currently on top - so, you can't work in one window and have the synthetic mouse clicking in another.

What you could try however, is to write an extension for your browser - there you have the possibility of accessing any element of a website in any tab (a button, for example) and on that element, you can automatically emit a click event. For Firefox (and probably most other browsers), this would be in JavaScript, mainly.

Upvotes: 0

Snir Ego
Snir Ego

Reputation: 98

It is actually like using two mice in parallel, it is possible as written in this article

Also for making it you can use these videos to guide you:

Run python script as background process

Python auto clicker (fixed location on screen)

Upvotes: 1

Related Questions