LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Newbie
User Name
Password
Linux - Newbie This forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Tags used in this thread
Popular LQ Tags , , ,

Reply
 
Thread Tools
Old 06-23-2009, 02:59 AM   #1
uni4dfx
LQ Newbie
 
Registered: Jun 2009
Posts: 5
Thanked: 0
Question Two mouse buttons to trigger an action


[Log in to get rid of this advertisement]
Hello.

I'm a lazy bastard with a Logitech MX1000 mouse. It has 10 buttons, so I can do lots of things with them. But that's not enough. I want to use one of the buttons as a 'modifier' in combinations with other mouse buttons to trigger (hopefully up to 18) different actions.
MX1000 has a "Window List" button (technically called b:10) that is perfect for this. I can map it to a specific action with xbindkeys as following:
Code:
# Some Action:
"/usr/bin/some_action"
  m:0x10 + b:10
But what I really want do is bind it to a combination of two (or possibly more?) mouse keys.
I have tried doing it this way:
Code:
# Some Action:
"/usr/bin/some_action"
  m:0x10 + b:10 + b:13
(button 13 is when you push the scroll wheel to the left - the same as b:6+Release)
But this does not work. It gets triggered when I press b:13, but not in combination with b:10. (If I swap b:10 and b:13, it only works when I press b:10)

I've found a hacky workaroundish way to do it, but it is not that great. What I did was bind button10 to "echo 1 > ~/.mymodkey" and button10/release to "echo 0 > ~/.mymodkey" and then I check this value on other keys. Here is the xbindkeysrc:
Code:
# Toggle mouse modifier:
"echo 1 > ~/.mymodkey"
  m:0x10 + b:10

# Untoggle mouse modifier:
"echo 0 > ~/.mymodkey"
  m:0x10 + b:10 + Release

# Next Song
"if [ "`cat ~/.mymodkey`" -eq "1" ]; then rhythmbox-client --next ; fi"
  m:0x10 + b:14

# Previous Song:
"if [ "`cat ~/.mymodkey`" -eq "1" ]; then rhythmbox-client --previous ; fi"
  m:0x10 + b:13
But this isn't exactly a good solution, because I can't make useful combinations like b:10 and b:1 ... xbindkeys grabs the defined keys so they no longer do what they originally did. And I still need to be able to leftclick.

So, how do I do this?
Can I add a new (mouse!) modifier key with xmodmap? I saw my mod3 is still unused. Is it possible to map it to a mouse key at all?
Is it possible to bind something (with xbindkeys or w/ something else) parallel to its original function?
Any other solution?

Last edited by uni4dfx; 06-23-2009 at 05:33 AM..
uni4dfx is offline  
Tag This Post , , ,
Reply With Quote
Old 06-24-2009, 02:07 AM   #2
uni4dfx
LQ Newbie
 
Registered: Jun 2009
Posts: 5
Thanked: 0

Original Poster
Bump
uni4dfx is offline     Reply With Quote
Old 06-25-2009, 04:10 AM   #3
uni4dfx
LQ Newbie
 
Registered: Jun 2009
Posts: 5
Thanked: 0

Original Poster
Bump
uni4dfx is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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
Action trigger on DHCP lease Cidi Rome Linux - Networking 3 03-05-2008 12:14 PM
Mouse back and forward buttons are interpreted as buttons 2 and 3 (MX610) jot-87 Linux - Hardware 1 08-06-2007 12:12 PM
Trigger action when module is inserted (wake on lan) benjalien Debian 12 04-25-2006 02:16 AM
GTK+ dialog: want to display buttons vertically in action area paulsm4 Programming 0 06-22-2005 07:46 PM


All times are GMT -5. The time now is 09:30 AM.

Main Menu
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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration