LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux 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


Reply
  Search this Thread
Old 02-09-2009, 06:26 PM   #1
tenmiles
Member
 
Registered: Nov 2004
Distribution: fedora core 3
Posts: 43

Rep: Reputation: 15
Configuring logitech mouse and keyboard buttons


I have a Logitech G5 mouse and G11 keyboard and I run Ubuntu 8.10. So far I've come to understand that I need to make a new .fdi file in /etc/hal/fdi/policy for my mouse and keyboard settings, but I can't wrap my mind around the details.

For the mouse I know what the button numbers are:
1: Left Button
2: Middle Button
3: Right Button
4: Wheel Scroll Up
5: Wheel Scroll Down
6: Wheel Tilt Left
7: Wheel Tilt Right
8: Lower Thumb Button
9: Upper Thumb Button

What I want to do is make 6 do a middle click and 7 to do ALT-TAB.

I don't have the slightest clue what the buttons are called for my keyboard, but I imagine the .fdi configuration is the same.

If anyone could help me with this I would really appreciate it. Thank you.
 
Old 02-09-2009, 08:07 PM   #2
Drakeo
Senior Member
 
Registered: Jan 2008
Location: Urbana IL
Distribution: Slackware, Slacko,
Posts: 3,098
Blog Entries: 3

Rep: Reputation: 325Reputation: 325Reputation: 325Reputation: 325
/etc/xorg.config
this mouse has been around for a while it is a simple usb plugdevice. all you need to do it plug it in and use it. you may have to configure it. not hard. If 810 does not do this automatically you did not configure mouse on install for a usb. boot recovery mode and configure it.or this write here will work on all mice.
Quote:
Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/input/mice"
Option "ZAxisMapping" "4 5 6 7"
EndSection
or try this one to
to set the mouse pointers to point to the correct section. In my
config, I have it set to:
Quote:
Section "InputDevice"
Identifier "USB Mouse"
Driver "mouse"
Option "SendCoreEvents" "true"
Option "Device" "/dev/input/mice"
Option "Protocol" "ImPS/2"
Option "Emulate3Buttons" "true"
Option "ZAxisMapping" "4 5"
EndSection
That works very well for me because /dev/input/mice catches input from
all the /dev/input/mouse* devices. /dev/input/mouse0 is my touchpad,
/dev/input/mouse1 is my usb mouse. On a 2.6 kernel, the setup should
be same for your touchpad. Not sure if a PS/2 mouse will show up in
/dev/input/mice or elsewhere.

If this does not work, then the alternative is to have 2 mouse entries
in your "ServerLayout" section. This is what I have:

Quote:
Section "ServerLayout"
Identifier "Default Layout"
Screen "Screen1"
InputDevice "Generic Keyboard"
InputDevice "Configured Mouse"
InputDevice "USB Mouse"
EndSection
The 'Configured Mouse' is actually my touchpad. Don't ask me, I didn't
name it . Just add the definition for your PS/2 mouse there as well.

Hope that helps.

Ken

Last edited by Drakeo; 02-09-2009 at 08:15 PM.
 
Old 02-09-2009, 08:34 PM   #3
tenmiles
Member
 
Registered: Nov 2004
Distribution: fedora core 3
Posts: 43

Original Poster
Rep: Reputation: 15
8.10 doesn't use xorg.config anymore, it uses HAL which is where the .fdi files come into play (http://ubuntuforums.org/showthread.php?t=990137).

I see all kinds of things saying how to write these files, but I'm new to this and I don't see anything explaining how to map things like ALT-TAB to a mouse button.

If I understand it right there will be <merge key="input.x11_options.Emulate3Buttons"type="strin g">True</merge> at some point to make default settings and then I customize beyond that, but that's where I get lost (assuming I what I think thus far is correct).
 
Old 02-09-2009, 08:45 PM   #4
Drakeo
Senior Member
 
Registered: Jan 2008
Location: Urbana IL
Distribution: Slackware, Slacko,
Posts: 3,098
Blog Entries: 3

Rep: Reputation: 325Reputation: 325Reputation: 325Reputation: 325
thanks for telling me that seems they are merging a layer in the system. I know I will not be using that system ever. they do this to allow hal to automate stuff.and load it. kinda like windows may be. I will read in to this. but I doubt I will ever use this type of system I prefer a 5 layer system unlike debian or windows ubuntu or mac
 
Old 02-09-2009, 09:38 PM   #5
tenmiles
Member
 
Registered: Nov 2004
Distribution: fedora core 3
Posts: 43

Original Poster
Rep: Reputation: 15
I was sorta able to get part of it working with

$ xmodmap -e "pointer = 1 6 3 4 5 2 7 8 9"

but I find it kind of annoying to only be able to use each number once. I would prefer 1 2 3 4 5 2 7 8 9 so that the actual middle click still middle clicks, as does tilting the wheel to the left. This solution also doesn't help me with binding other types of things to the other buttons, just moving the buttons around.
 
Old 02-09-2009, 10:16 PM   #6
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959
It's not quite true to say that xorg.conf isn't used any more. It still falls back to using it if there aren't any fdi rules set up.

To configure keyboard multimedia keys, you need to bind their keycode numbers to keysyms using xmodmap. Then you can use them just as you would any other keyboard keys; in hotkey actions, for example. There's a detailed wiki for it here.


To configure mouse and keyboard buttons to do things, try using xbindkeys. And you can use xdotool with it to generate simulated keypresses. So to make mouse button 7 send an Alt+Tab event, for example, try configuring an xbindkeysrc entry to:

Code:
"xdotool key Alt+Tab"
     b:7
It's not perfect, but it works pretty well overall. I have all the buttons on my Kensington Expert Mouse Pro linked to simulated F13-F20* function keys, so I can do things like switch desktops and call up programs with them.


*You can activate unused keysyms like F13 and above without having any specific keycode to map them to by using "xmodmap keycode any = F13". It will use the first available unused keycode for it's binding.

Last edited by David the H.; 02-09-2009 at 11:11 PM. Reason: corrected a mistake
 
Old 02-09-2009, 10:29 PM   #7
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959
Quote:
Originally Posted by Drakeo View Post
thanks for telling me that seems they are merging a layer in the system. I know I will not be using that system ever. they do this to allow hal to automate stuff.and load it. kinda like windows may be. I will read in to this. but I doubt I will ever use this type of system I prefer a 5 layer system unlike debian or windows ubuntu or mac
Hal integration is necessary for providing hotplugging ability for complex peripherals like multi-button mice and graphics tablets and such. Without it all the special events get lost as soon as you unplug the device, or suspend your notebook or something, and you have to restart X in order to get everything working again.

So don't go thinking that it's just an unnecessary extra layer. You may not need it, but other people do. It's really a long overdue extension to X.
 
Old 02-10-2009, 03:10 AM   #8
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287
I don't know how to do all that exactly, but here are some good resources for these types of configs:
http://www.gentoo-wiki.info/HOWTO_Use_Multimedia_Keys
http://www.gentoo-wiki.info/HOWTO_Advanced_Mouse
http://www.gentoo-wiki.info/X11_Mous...itech_G5.2C_G7
 
Old 02-10-2009, 06:54 PM   #9
tenmiles
Member
 
Registered: Nov 2004
Distribution: fedora core 3
Posts: 43

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by David the H. View Post
It's not quite true to say that xorg.conf isn't used any more. It still falls back to using it if there aren't any fdi rules set up.

To configure keyboard multimedia keys, you need to bind their keycode numbers to keysyms using xmodmap. Then you can use them just as you would any other keyboard keys; in hotkey actions, for example. There's a detailed wiki for it here.


To configure mouse and keyboard buttons to do things, try using xbindkeys. And you can use xdotool with it to generate simulated keypresses. So to make mouse button 7 send an Alt+Tab event, for example, try configuring an xbindkeysrc entry to:

Code:
"xdotool key Alt+Tab"
     b:7
It's not perfect, but it works pretty well overall. I have all the buttons on my Kensington Expert Mouse Pro linked to simulated F13-F20* function keys, so I can do things like switch desktops and call up programs with them.


*You can activate unused keysyms like F13 and above without having any specific keycode to map them to by using "xmodmap keycode any = F13". It will use the first available unused keycode for it's binding.
I got this working and it now does do pretty much what I wanted it to do, but if I hold down the button (tilt the wheel to the right) it spams Alt+Tab instead of acting like I was holding them down. Not a big deal, but if you know how to get around that it would be nice. Thank you very much for the help!
 
Old 02-10-2009, 11:05 PM   #10
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959
Quote:
Originally Posted by tenmiles View Post
I got this working and it now does do pretty much what I wanted it to do, but if I hold down the button (tilt the wheel to the right) it spams Alt+Tab instead of acting like I was holding them down.
I'm not 100% sure what you mean by "spam" here, but I think I get the basic image. Unfortunately, that's one of the "not perfect" things I mentioned. xbindkeys works by detecting keypresses, and sends the command once for each keypress. So things like holding down buttons might not do what you want. I have two buttons on mine mapped to page down & page up, and while holding down the buttons on the keyboard sends repeated commands, it doesn't work through the mouse.

It seems like your problem is the opposite of mine though, and the button presses won't stop. One thing you might try is setting up the command with the special "release" modifier. Then the action will only occur when the button is released.

xbindkeys also has the ability to do more advanced stuff if you use the guile/scheme-based .xbindkeysrc.scm config file instead. You can set up short scripts that will allow things like multiple-click and timed-click patterns and such. But it's more advanced stuff that requires understanding the scheme scripting language. I personally haven't been able to do much with it yet, but I'm hoping some day when I have time to see if I can program in a repeating key of some kind. It's a long way off though.
 
Old 02-10-2009, 11:24 PM   #11
Drakeo
Senior Member
 
Registered: Jan 2008
Location: Urbana IL
Distribution: Slackware, Slacko,
Posts: 3,098
Blog Entries: 3

Rep: Reputation: 325Reputation: 325Reputation: 325Reputation: 325
Quote:
So don't go thinking that it's just an unnecessary extra layer. You may not need it, but other people do. It's really a long overdue extension to X.
what I am say is it is using less layers and before you know it hal scripts will be writing scripts. just the more you you automate things the less control you have as things may change.
Linux is getting huge now days and people just want that one click. Unfortunately some times this causes security problems. this is just a point of view. why break it KISS is the good stuff.
 
Old 07-05-2009, 06:11 AM   #12
Melhisedek
LQ Newbie
 
Registered: Aug 2004
Posts: 29

Rep: Reputation: 15
First of all sorry for bumping this old thread, but I have the exact same issue. Sadly my knowledge of Linux is really limited so I'm not able to solve this on my own. Second of all I can't believe someone uses same mouse as I do and also exact same things with left and right tilt

Anyway could you please post your xbindkeysrc and where should I put it so it will be enabled after each restart?
Thank you for your time!
 
  


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
Overnight bluetooth keyboard/mouse dropout. Logitech MX1000, Logitech MX5000. Xubuntu Mysticle31 Linux - Hardware 2 04-11-2008 12:40 PM
Logitech MX610 mouse: configuring the thumb buttons Jiawen Linux - Hardware 3 03-29-2006 03:35 AM
Logitech wireless keyboard and mouse configuring maelstrom209 SUSE / openSUSE 1 08-19-2005 09:59 PM
new logitech keyboard buttons freak out mouse icyfire Linux - Hardware 1 07-01-2003 12:18 AM


All times are GMT -5. The time now is 07:41 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration