LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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



Reply
 
Search this Thread
Old 10-12-2006, 02:37 PM   #1
xmrkite
Member
 
Registered: Oct 2006
Location: California, USA
Distribution: Mint 16, Lubuntu 14.04, Mythbuntu 14.04, Kubuntu 13.10, Xubuntu 10.04
Posts: 542

Rep: Reputation: 30
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.
 
Old 10-17-2006, 02:27 PM   #2
xmrkite
Member
 
Registered: Oct 2006
Location: California, USA
Distribution: Mint 16, Lubuntu 14.04, Mythbuntu 14.04, Kubuntu 13.10, Xubuntu 10.04
Posts: 542

Original Poster
Rep: Reputation: 30
Found a workaround. you can delete this thread.
 
Old 10-17-2006, 03:14 PM   #3
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,211

Rep: Reputation: 293Reputation: 293Reputation: 293
Hi xmrkite, would you mind posting the solution/workaround for the benefit of other people searching for similar solutions?
 
Old 10-17-2006, 03:45 PM   #4
xmrkite
Member
 
Registered: Oct 2006
Location: California, USA
Distribution: Mint 16, Lubuntu 14.04, Mythbuntu 14.04, Kubuntu 13.10, Xubuntu 10.04
Posts: 542

Original Poster
Rep: Reputation: 30
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.
 
Old 10-17-2006, 03:53 PM   #5
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,805

Rep: Reputation: 324Reputation: 324Reputation: 324Reputation: 324
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.
 
Old 10-17-2006, 03:57 PM   #6
xmrkite
Member
 
Registered: Oct 2006
Location: California, USA
Distribution: Mint 16, Lubuntu 14.04, Mythbuntu 14.04, Kubuntu 13.10, Xubuntu 10.04
Posts: 542

Original Poster
Rep: Reputation: 30
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)
 
Old 10-17-2006, 06:39 PM   #7
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,211

Rep: Reputation: 293Reputation: 293Reputation: 293
Could you send me a pm here when it's done?

Cheers
 
Old 10-17-2006, 06:51 PM   #8
kevkim55
Member
 
Registered: Dec 2005
Location: Edmonton
Distribution: BLFS, Gentoo
Posts: 353

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

Last edited by kevkim55; 10-17-2006 at 06:52 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
bash script: using "select" to show multi-word options? (like "option 1"/"o zidane_tribal Programming 6 03-21-2013 11:35 AM
Disable "Shift+left mouse button" combination (XFree86). cibonato Linux - General 2 08-17-2006 06:22 PM
PS2 keyboard doesn't work after the "Enter" key is used gonefishing Suse/Novell 1 11-06-2004 11:02 PM
"I have a4 tech 5 button mouse but can't use the two for back&forward in browsing " aicholate Linux - Hardware 1 02-26-2004 12:16 PM
<input type="button" disabled="true" > does not work in ns4.7 or 4.9 cybercop12us Programming 2 11-29-2002 09:31 AM


All times are GMT -5. The time now is 01:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration