Customize Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorized as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

No cookies to display.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

No cookies to display.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

No cookies to display.

Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.

No cookies to display.

Advertisement cookies are used to provide visitors with customized advertisements based on the pages you visited previously and to analyze the effectiveness of the ad campaigns.

No cookies to display.

Python autoclicker with pynput

Install python

Check does you have python install, open up Terminal and use the following command to check

python3 --version

if the output gives you a version number then you have python installed

if you get command not found, go to python website to download and install the latest python for your operating system.

Install pip

Check does you have pip install, open up Terminal and use the following command to check

pip --version

Download setup script

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py

Run the setup

python3 get-pip.py

Let’s begin

you need to install the python module pynput

pip install pynput

then create a autoclicker.py file

touch autoclicker.py

open up the file with your text editor of your choice and paste in the following code

# importing time and threading
import time
import threading
from pynput.mouse import Controller, Button  
# pynput.keyboard is used to watch events of 
# keyboard for start and stop of auto-clicker
from pynput.keyboard import Listener, KeyCode
  
  
TOGGLE_KEY = KeyCode(char="t")

clicking = False
mouse = Controller()

def clicker():
    while True:
        if clicking:
            mouse.click(Button.left, 1)
        time.sleep(0.001)

def toggle_event(key):
    if key == TOGGLE_KEY:
        global clicking
        clicking = not clicking

click_thread = threading.Thread(target=clicker)
click_thread.start()

with Listener(on_press=toggle_event) as listener:
    listener.join()

How to run the program

go to terminal and use python3 autoclicker.py to run the python program and use “t” to toggle the auto click function