As i'm currently using only a wireless mouse to work with my LMCE and I was annoyed by using the keyboard for F6,F7,F8, I tried to figure out a way to have the additional mouse-buttons act as those keys...
If there is a simpler way, please reply and let me know...
If you have the same problem, enjoy...
First of all, we need the packets xautomation (which should be installed allready) and xbindkeys (which we can install by sudo apt-get install xbindkeys; you might have to append "deb
http://archive.ubuntu.com/ubuntu/ feisty universe" to /etc/apt/sources.list temporarely, if i recall it correctly).
We use xautomation (xte) to simulate the key-presses:
if you want to send a keypress of F6 to the X-Server, the command "xte 'key F8'" will do the trick.
if you only want to send that the key was pressed, call "xte 'keydown F8".
additionally you can event move the mouse or do clicks with it. For more information have a look at "man xte".
To catch the keypresses on the mouse, we use xbindkeys. The syntax of the config-file is:
"xterm"
control+shift + q
so within the "" is the command to call and below is the key to bind the command to.
possible keys are control, shift, alt, ... and for mouse-buttons b:1, b:2, b:3, ...
combining those two, we derive the following configfile, which i saved at /etc/xbindkeysrc:
"xte 'keydown F6' &"
b:8
"xte 'keyup F6' &"
b:8+release
"xte 'keydown F7' &"
b:2
"xte 'keyup F7' &"
b:2+release
"xte 'keydown F8' &"
b:9
"xte 'keyup F8' &"
b:9+release
Then we still have to start xbindkeys within the X-Server... As I do not know LinuxMCE too well, I just looked for some good spot and /usr/pluto/bin/lmce_launch_manager.sh seemed to be one. Now it looks like this:
...
xbindkeys -f /etc/xbindkeys <--- the added stuff
KDE_DEBUG=1
LM_BINARY=/usr/pluto/bin/lmce_launch_manager
LM_EXIT_CODE=-1
...
After a reboot, the mouse-buttons 8, 2 and 9 should act as F6, F7 and F9 even passing when a key is held pressed, which was the right setup for me.
If you want something different, just change b:9 for b:6 for example.
If you don't know the numbers of your mousebuttons, start the "application" xev. Click into the small black box and look at the console for the output "ButtonPress event, .... button X".
In case you do not get all the buttons of your mouse, e.g. 8 and 9 report as being 1 and 2 (that was the case with my mouse), try replacing
Option "Protocol" "ImPS/2"
with
Option "Protocol" "ExplorerPS/2"
Hope that helps some of you to save some time...
Cheers... Chewi