Well here is a rough draft, happy hacking.
---------------------------------------------------
HOWTO: Configuring Logitech mx310 mouse in Slackware
Version: 1.0
Issue Intent: Draft Copy, For Peer Review, Discussion & Correction Purposes Only.
Date: 10/07/2006
Foreword:
This how to is based upon the following well written Ubuntu how-to guide located at:
http://www.ubuntuforums.org/showthre...logitech+mx500
Please understand that his how-to was so accurate it worked like a charm in Ubuntu for me, and only needed the slightest of tweaks for Slackware and hence, there is not much for me to change to be my own words.
Security Warning:
Please note, software used in this how-to will monitor and alter the keyboard send/event and mouse send/event of your computer's hardware. The author's of these files do not offer a GPG key signing and/or md5 checksum for your download files that are used in this how-to. If you cannot live with the possible security implication's that these files pose, then this guide is NOT for you. I accept no responsibility of any kind for your experiences as a result of using this guide and/or the associated files required to follow this guide. You have been warned. I have written the author's and requested this information, and I humbly request that you do the same. However, to date I have had no response. One thought that comes to my mind, is that an alternate solution to this issue could be to use sources from debian in apt, as those files are "supposedly" highly scrutinized, though I cannot validate that comment either. I can say that the Ubuntu tutorial has met my expectations.
My Setup (hardware & software)
-OS: Slackware 11.0 (installed with full nooby install)
-Mouse: Logitech MX310
A link to what my mouse looks like:
http://www.amazon.co.uk/Logitech-930.../dp/B0000AZJWK
Shameless Banter Section:
Logitech please start making this mouse again, there is nothing else to use that is satisfactory for left handed gamer's, video artists or CAD designer's, etc. please continue the manufacturing of this mouse
I recommend any one who uses this mouse to quickly go out and purchase extra's really soon, supplies are limited.
Files That You Will Need To Download:
"xvkbd" from
http://homepage3.nifty.com/tsato/
"xbindkeys" from
http://hocwp.free.fr/xbindkeys/xbindkeys.html
"checkinstall" from slackware extra cd.
"lomoco"from
http://www.linux-gamers.net/modules/...p?storyid=1158
Assumptions:
-Skill level of user : Not for beginner's or weak of stomach, but you don't have to have a last name beginning with a "V" either
-This guide is not for use with "production machines"
-KDE is installed.
-You are using the huge26 kernel or at least a kernel that evdev and udev compiled accordingly to the kernel and they are working and running (verify with "lsmod" in console if need be).
-You understand that it's probably a good idea to read this how-to, the original how-to and will print out a copy before you begin. There is a damage control section listed at the end to give some pointers in the event that something goes wrong.
Estimated Time To Set Aside:
Realistically, probably an hour because you really should read the how-to's, download files, print this out and reboot a couple of times.
Let's Begin:
Optional, tell Slackware to use run level 3 just in case we mess up our udev rule or xorg file.
now change the line "id:4:initdefault:"
to
id:3:initdefault:
control key & o #letter o this saves the file
control key & x #this exits the pico editor.
Reboot into run level three with your mx310 mouse plugged in.
Let's find out how slack see's the mouse:
Quote:
cat /proc/bus/input/devices
output:
I: Bus=0003 Vendor=046d Product=c01b Version=1800
N: Name="Logitech USB-PS/2 Optical Mouse"
P: Phys=usb-0000:00:02.2-4.1/input0
S: Sysfs=/class/input/input3
H: Handlers=mouse0 event3
B: EV=7
B: KEY=3f0000 0 0 0 0 0 0 0 0
B: REL=103
|
This line "N: Name="Logitech USB-PS/2 Optical Mouse"" in the resultant output is what is of concern to us. I was lucky, my mouse was seen the same way as the original writer's how-to. Your's may vary for your mouse so pay attention to this.
Now we are going to add a udev rule so Slackware will always recognize your mouse.
open up a text editor and paste the following (as normal user not root):
Quote:
KERNEL=="event[0-9]*", SYSFS{../name}=="Logitech USB-PS/2 Optical Mouse", NAME="input/event9"
|
substitute in the above line including the quotations the name of your mouse as given to you from the "cat /proc/bus/input/devices" code's output. (e.g."Logitech....")
save file to your desktop as "19-local.rules" don't close text editor yet
we need to see which udev event numbers are used in your system:
resultant output:
Quote:
event0 event1 event2 event3 mice mouse0 ts0
|
We see in the above output that event 4 through 9 is not used, so like the ubuntu guide, I used event 9 for my "19-local.rules" file.
Now that we have made the udev rule file let's move it to the correct place on our system.
Close out your text editor.
Quote:
su
chown root:root ~/Desktop/19-local.rules
cp ~/Desktop/19-local.rules etc/udev/rules.d/19-local.rules
|
Okay, now let's stay as root as we need to edit the xorg.conf file.
So we back it up first.
Quote:
cp /etc/X11/xorg.conf /etc/X11/xorg.conf.mygoodbackup.bak
|
Now let's actually edit the file:
scroll down to Section "InputDevice"
place a comment in front of what you have there or just delete the lines, it's up to you. just be sure to leave the Section "InputDevice" line and the "EndSection" lines there in the file.
now add the following:
Quote:
Identifier "Mouse 1"
Driver "evdev"
Option "CorePointer"
#the following line should match etc/udev/rules.d/19-local.rules file made
Option "Device" "/dev/input/event9"
|
now before we save this xorg.conf file, please confirm that the Identifier line that you just typed matches the Identifier used in the Section "ServerLayout". Here is a copy of mine just in case you need it:
Quote:
Section "ServerLayout"
Identifier "Simple Layout"
Screen 0 "aticonfig-Screen[0]" 0 0
InputDevice "Mouse1" "CorePointer"
InputDevice "Keyboard1" "CoreKeyboard"
EndSection
|
now let's save our newly modified xorg file with 'control key & letter o' key
now let's exit pico with 'control key & letter x' key.
Now we need to reboot to let udev see our newly created udev rule.
So reboot...and I'll wait
Ok once you get back up into Slackware at log in prompt just type 'startx' to get into KDE.
Ok hopefully we have a working mouse. Now we haven't done anything yet for our "fancy" side buttons. Let's work on that part now.
I will assume from this point you downloaded the respective files. Let's compile them and install them now.
Untar the 'xvkbd' download file to a folder as a normal user to your usual scratchpad area in your path that you do your builds in.
go into the xvkbd source extract folder
Quote:
f4 key #brings up konqueror
./configure --prefix=/usr
make
su
checkinstall
installpkg ~/scratchpad/newly-created-xvkbd.tgz
#or you could just type 'pkgtool' and use that too.
exit
|
now close konsole.
Untar the 'xbindkeys' download file to your scratchpad area, again in your path. This program gave me a ton of error's it wanted 'libguile'. Using ./configure --help showed that I could disable this gnome requirement.
Quote:
f4 key#brings up konqueror
./configure --prefix=/usr --disable-guile
make
su
checkinstall
installpkg ~/scratchpad/newly-created-xbindkeys.tgz
#or you could just type 'pkgtool' and use that too.
exit
|
Now keep console open, but be sure you typed exit so your not root, use 'whoami' to make sure.
Now here is where the original writer lost me, he wants us to edit the ~/.xbindkeysrc file, but I didn't have one at this point and neither will you. Turns out I had to run "xbindkeys " in console as a normal user, the xbindkeys server will see that I do not have this file, and it will auto-create this hidden file in my home directory for me.
So startup xbindkeys server. Then we need to kill it, or close it, so that we can edit the newly created default .xbindkeysrc file in our 'user' home directory.
In console 'killall xbindkeys'
Now by default the xbindkeys team binds the keyboard event of 'control key & f4 key' to open up xterm, which is nice and all, but I use that key sequence a lot to find things in my text files, web-browser, log's, etc.
So (optionally) you might want to comment out these line's with a # sign.
This section here is default
Quote:
# specify a mouse button
"xterm"
control + b:2
|
Change it to looks like this:
Quote:
# specify a mouse button
#"xterm"
#control + b:2
|
Now, if you are not using an 'mx310' mouse the following is what will definitely be different for you.
I had to go down and change/add these lines:
Quote:
#the following line make button 8 of my mouse issue the Alt Key & Left Arrow key
"/usr/bin/X11/xvkbd -xsendevent -text "\[Alt]\[Left]""
m:0x0 + b:8
#the following line make button 8 of my mouse issue the Alt Key & Right Arrow key
"/usr/bin/X11/xvkbd -xsendevent -text "\[Alt]\[Right]""
m:0x0 + b:9
|
Note: A right handed person might want to swap the b:8 and b:9 up there not sure. need to work on that to be sure.
The importance of the newly created above lines is as follows:
'b:8' for example stands for button 8. for me, that is one of the fancy long black side buttons on my mouse. How did I know that b:8 was this particular button you say? I used 'xev' in console. It is part of xorg so it's already installed for us by Mr. Pat V. If we just type in console 'xev' as a normal user, our console will echo really whipping fast all of the xevents that it is seeing, from here, you will see the button number for the key you pressed. You will most certainly have to play with this if you do not have an mx310 mouse and figure out what's exactly going on, just look for a "b:" followed by a number as a guide. (hmm...fix me man page for this ?)
The ubuntu guide has more example's and mice specific "b:" number options.
Now save the file. Let's test it first and make sure the mouse does what you want. In the example above, the Alt\left Alt\Right events are mapped to the black side buttons of my mouse. So for example when I press the left side long black button on my mouse it sends the Alternate key & Left Arrow key event to my Slackware. Where can I use that? Firefox Opera use this as the 'back' command when I web browse. Conversely the right long side button of my mouse now sends the Alternate key & Right Arrow key event to my Slackware. This let's me go forward a web-page in Slackware.
So let's start up xbindkeys's daemon/server by "xbindkeys" in console.
Open firefox and test it out by browsing some pages and going back/forward with your fancy buttons there. Hopefully this worked. It is possible that if you have a mouse other than an mx310 you may not work here. I'll touch on this in a moment.
Just to finish up on browser tweaks. I also use konqueror for links for KMail, akregator too. So open up konqueror web browser, then 'settings' then 'configure shortcuts' scroll down to "Konqueror" section then "back" and modify the key there by clicking custom, and multi-bind key, place the cursor in the box to the right, and then I click my long left side button and I see on the screen it says "Alt+Left" so now Konqueror works too
So where are we at this point:
1. we have a udev rule.
2. if we are lefty...like old_fogie ...this stinks, it's like having a right handed mouse on my left side of keyboard. Its' a well known fact that left handed people think in the "right side" of the brain LOL I luv that one. Really no joke, 'it's in the books'.
3. mx310 has all fancy buttons recognized except for the tiny mouse button on middle top of mouse.
4. xbindkeys server runs but does not start up with KDE.
5. our fancy 800 dpi mouse is only running at 400 dpi
because xorg & KDE don't consider but only flame people on feature request lists
Why has the toggle 400/800 dpi toggle been removed KDE? tired of the requests?
7. need to tweak mouse speed's so we have some de-acceleration to edit our photo's real nicely in the gimp, and really control our mouse when we use the lightning gun to headshot noobs in Unreal Tournament
because xorg & KDE don't consider but only flame people on feature request lists
Okay, let's get the right and left click keys of the mouse to be left handed.
Open up control center in KDE, then peripherals, then mouse and change it to right handed...yes we change that to right handed tho we are going to be using our mouse lefty. Don't worry there are notes here for those 'righty's' here too.
Now close out control center.
Open up your text editor and paste this:
Quote:
#! /bin/sh
# for slackware 11.0 swap 3 and 1 below for right handed users only leave as is for
# left handed mouse operations.
/usr/X11R6/bin/xmodmap -e "pointer = 3 1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32"
#internal note fogie used to use "pointer = 3 2 1 6 7 4 5" in slackware 10.2 more
#numbers are now needed in slackware 11.0
#this line starts up the xbindkeys server with KDE
/usr/bin/xbindkeys
|
now save your file as something like
Quote:
"my-tweaked-leetzor-mouse-settings.sh"
|
now right click on it then properties and make it executable.
I suppose they probably could go into our xorg.conf file in same way shape or form for us, but I don't know how to do that. Or if we use a different window manager how we might tackle this either.
Ok before we just exit KDE, let's test that xmodmap -e ...line in our ...mouse-settings.sh file.
As a normal user just paste the entire line in konsole, and test your mouse buttons out. If they work correctly for you as a lefty (remember mine is lefty) or you changed it for right handed, and you feel comfortable with it. We do one final step to play it safe.
With konsole up 'killall xbindkeys' then
Quote:
sh ~/.kde/Autostart/my-tweaked-leetzor-mouse-settings.sh
|
Now test your mouse...is it working correctly. Browse some pages, etc. If all is well, now exit KDE, then go back in and test again.
If the results are not what you expected you can just changed the numbers in the xmodmap line in our mouse.sh file with a text editor and then run "control key & letter e" key in konqueror over and over as you go until you get it the way you expect.
OKAY, two last things to do..get some de-acceleration & get 800 dpi mouse.
Open up our ~/.kde/Autostart/my-tweaked-leetzor-mouse-settings.sh with our text editor and add:
Quote:
#the below line gives me a de-acelerated mouse cuz xorg & KDE team don't consider
#user's requests for things like CAD/CAM, 3dpipe design, photo editing or games.
/usr/X11R6/bin/xset m 7/10 2
|
Now save your file.
Okay. let's get our high resolution working.
untar your lomoco download file into the scratchpad package building area in your path.
Quote:
./autogen.sh
./configure --prefix=/usr
make
su
checkinstall
installpkg ./my-newly-created-lomoco.tgz
pico /etc/rc.d/rc.local
|
just add these lines:
Quote:
/usr/bin/lomoco -8
control key & letter O key to save
control key & letter x key to exit pico editor
exit #so we become a normal user account.
|
the line that we added /usr/bin/lomoco -8 tells lomoco to use the 800 dpi settings.
Let's just test it before we start up the pc.
type in console
Did the mouse seem faster? It's working
That's it, let's reboot the computer and make sure all is well.
I would say that after you reboot, and you startx, and go into KDE and see it's all working then edit you iniittab again as root and turn it back to run level "4" again. It's best that you use run level 3 IMO when doing stuff like this.
Damage Control:
Okay what if you totally mess up, how to get back to where you were before you started this howto from the command line interface at run-leve 3 command prompt:
Quote:
rm /etc/X11/xorg.conf
cp /etc/X11/xorg.conf.mygoodbackup.bak /etc/X11/xorg.conf
rm ~/.kde/Autostart/my-tweaked-leetzor-mouse-settings.sh
rm /etc/udev/rules.d/19-local.rules
|
optional:
as root run 'pkgtool' and remove the installed packages from your system.
Reboot the pc and you should now be back to your original settings, except for the download files and the packages you made are sitting in your scratchpad.