How to have mouse button act as "enter" key in bash
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How to have mouse button act as "enter" key in bash
Hello,
I'm setting up a digital picture frame out of an old laptop, and I want to mount the two mouse buttons on the frame and have them do cool stuff.
I have written a simple bash script and have installed xbindkeys.
When you click the right mouse button, xbindkeys loads my script which kills xbindkeys, leaving my mouse open for other uses.
So I'm trying to find out how i can make it so that the left and right mouse buttons act as my responses to the script. (like a yes,enter and a no,enter response)
For example,
Instead of:
"Press 1 then enter to run script1"
"Press 2 then enter to view next option" (the next option would be like: Press 1 then enter to run script2") and so on.
I'd like to have: "Press left mouse button to run script1"
and also to have: "Press right mouse button to view next option"
This way, my mouse sort of acts like it's own mini on screen display.
Also, how do i do it so that the right button could do this, i mean, i don't know how to do this using regular keys. From what i've seen, the enter key can get me to the next prompt, but how would i have it so that enter does one thing and say for example Backspace by itself does another thing (kinda like a virtual "2,enter" key)?
Last but not lease if anyone thinks there is a better way to do this, aka, a pre-existing program that can handle this, then please do let me know. Since i'm really new to this, having an aterm bash window open up isn't the prettiest thing on a nice looking digital picture frame.
The workaround I found was using xbindkeys. I decided not to go with a bash based menu option, but instead I got a few jpg/gif images that load fullscreen using feh. I start off by having the left click button open the main menu and then load a new xbindkeys config file which has the left button doing one thing and the right button doing another. Clicking the right button for example goes to the next option, the left button executes. At each click, a new xbindkeys config file is loaded. It makes for a lot of config files but the look of it is really nice, especially for someone who has no idea on how to program anything.
Hope that makes sense. If you like, i can give more details, including screenshots.
I'm making a digital picture frame out of an old laptop and I wanted to have some control buttons, hence the mouse buttons. I probable will do a website when it's all said and done. With screenshots, scripts and more, it'll be very informative for someone looking to do something similar.
If you want, send me your email address, and i'll let you know when i get that site up (might be a month or two though)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.