Re: Mouse button binding

From: Dances With Crows (danceswithcrows_at_usa.net)
Date: 07/01/03


Date: 1 Jul 2003 20:39:07 GMT

On Tue, 01 Jul 2003 12:39:53 -0700, Charles-Henri staggered into the
Black Sun and said:
> I have a mouse with many buttons, and they're recognized by xev. But
> they're pretty useless now. Is there a way to bind a mouse button to
> something, like a key ?

When someone puts together a FAQ for this group, this question should go
on it. It's reasonably easy to bind a mouse button to any arbitrary
command, you use xbindkeys to do that. If you want to press a mouse
button and have a sequence of keypresses (or mouse button presses)
output, you use xmacroplay in combination with xbindkeys.

xbindkeys and xmacroplay are available on freshmeat.net. Both are small
and easily compiled.

Put this in ~/.xbindkeysrc , and pressing mouse button 6 will launch an
xterm :

# in ~/.xbindkeysrc
"xterm &"
  b:6

Put this in ~/.xbindkeysrc , and pressing mouse button 6 will echo the
Alt+Left key combination to the X server, which maps to "back" in
Konqueror and Mozilla :

# in ~/.xbindkeysrc
"echo -e 'KeyStrPress Alt_L\nKeyStrPress Left\nKeyStrRelease Left\n
KeyStrRelease Alt_L' | xmacroplay &"
  b:6

http://groups.google.com/advanced_group_search , this NG, keywords
"xbindkeys" and "xmacro". HTH,

-- 
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
Brainbench MVP for Linux Admin / 
http://www.brainbench.com     /  "He is a rhythmic movement of the
-----------------------------/    penguins, is Tux." --MegaHAL


Relevant Pages