Posts: 1
Joined: Thu Aug 17, 2017 2:19 pm

GPIO PUSH button = left mouse click

Thu Aug 17, 2017 5:53 pm

Hi everyone.

I have a push button connected to the raspberry pi GPIO and it works.

My code is

Code: Select all

import Rip.GPIO as GPIO
GPIO.setup (16,GPIO.IN)

GPIO.cleanup ()
How do I get the click of the button to act as a left mouse click? So that when I click on my button it registers as a left click.

Any help would be appreciated.

User avatar
Forum Moderator
Forum Moderator
Posts: 10921
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: GPIO PUSH button = left mouse click

Fri Oct 20, 2017 9:11 am

Adafruit has written drivers that convert buttons connected to the GPIO to keyboard inputs, maybe that is a start, and perhaps they also have something similar for mouse button clicks.
Another solution would be to connect a real USB mouse, and solder a button over the one in the mouse.

Return to “Beginners”

Who is online

Users browsing this forum: No registered users and 45 guests