Jump to content

Build a USB button to execute a terminal command in Ubuntu

German_John
Go to solution Solved by Sauron,
19 minutes ago, German_John said:

is there a way to just remap, say, middle click

Yes.

 

https://www.howtoforge.com/tutorial/map-mouse-on-linux/

Hey everyone,

 

for a project, I need to build a button (USB) that when pressed executes a command in the terminal (executes a python script, writes it to a file, prints it on a thermal printer). 

The system doesn't really need a mouse input, so is there a way to just remap, say, middle click to do that? Because then I'd just tear apart an old mouse.

What other options to I have? gamepads, makey makey, etc? EDIT: I do have a raspberry pi zero. The whole thing won't be connected to anything other than power in the end, so it'd have to execute the button press via the GPIO pins. 

It needs to be pretty small.

 

Also, if anyone has a more elegant way to do my command, be my guest. It's very cobbled together

 

I hope someone can help me out with that!

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×