LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to have mouse button act as "enter" key in bash (https://www.linuxquestions.org/questions/linux-software-2/how-to-have-mouse-button-act-as-enter-key-in-bash-491848/)

xmrkite 10-12-2006 01:37 PM

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.

xmrkite 10-17-2006 01:27 PM

Found a workaround. you can delete this thread.

dive 10-17-2006 02:14 PM

Hi xmrkite, would you mind posting the solution/workaround for the benefit of other people searching for similar solutions?

xmrkite 10-17-2006 02:45 PM

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.

bigrigdriver 10-17-2006 02:53 PM

That sounds like something I'd like to do with a housekeeping script I wrote and use almost daily.

You might condider writing it up as a tutorial and uploading it to the LQ Tutorials page.

xmrkite 10-17-2006 02:57 PM

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)

dive 10-17-2006 05:39 PM

Could you send me a pm here when it's done?

Cheers

kevkim55 10-17-2006 05:51 PM

Or better yet, post the news here. That way, you could have 100s if not 1000s hits to your website..... ! ;-)


All times are GMT -5. The time now is 11:20 AM.