Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
/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.
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:
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).
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
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.
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
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.
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!
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.
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.
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!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.