Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
05-01-2006, 06:25 PM
|
#1
|
Member
Registered: Jul 2005
Location: Minneapolis, Minnesota
Distribution: Ubuntu
Posts: 35
Rep:
|
changing the function of the middle mouse button
I've looked around, but can't seem to find what i am looking for. what i want to do is change the function of my middle mouse button. when i click and drag i want to move whatever window is below the mouse cursor, similar to [alt]+[lbutton drag]. when i double click my middle mouse button i want to execute a program (3ddesk). does anybody know how to do this? I am currently running an Ubuntu instalation on an intel machine.
Any help would be appreciated,
Florian
|
|
|
05-02-2006, 03:47 AM
|
#2
|
Member
Registered: Jan 2006
Location: Vancouver BC
Distribution: LFS, SLak, Gentoo, Debian
Posts: 291
Rep:
|
Mouse button configuration is GUI related, since Ubuntu uses GNOME the settings to alter the mouse are in the GNOME settings area.
since I personally don't use GNOME I can't be any more specific.
|
|
|
05-02-2006, 10:08 AM
|
#3
|
Member
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536
Rep:
|
The middle button is used to paste the current selection, a convention used by all X apps (well, all that accept user input). You really don't want to mess with this. OTOH, you might be able to do this only on the root window (background), but that depends on the flexibility of your window manager (I doubt GNOME is flexible enough to do this). However, you can safely change <modifier>+<button> to do whatever you want. As Jaqui says, this is entirely desktop/window manager dependant. (I don't use GNOME either).
Last edited by ioerror; 05-02-2006 at 10:11 AM.
|
|
|
05-02-2006, 10:10 AM
|
#4
|
Member
Registered: Jul 2005
Location: Minneapolis, Minnesota
Distribution: Ubuntu
Posts: 35
Original Poster
Rep:
|
my understanding is that the middle mouse button is an X-windows thing, and doesn't filter down to the gnome. The middle mouse button doesn't do anything in any program except paste the last thing selected.
I could edit my etc/X11/xorg.conf file to add a mouse button. I could then add:
xmodmap -e "pointer = 1 6 3 4 5 2"
to my .xinitrc file, but what then? how would i get button6drag to translate to alt+button1drag?
any help would be apreciated...
Florian
*** note: ioerror replied while i was typing this message...
|
|
|
05-02-2006, 10:16 AM
|
#5
|
Member
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536
Rep:
|
It really depends on your window manager. Some window managers can be configured to run programs on a given key or button press (with fvwm, for example, can do pretty much whatever you want). I don't know anything about GNOME so I don't know how to do it, or even if GNOME has that capability.
Quote:
The middle mouse button doesn't do anything in any program except paste the last thing selected.
|
What do you mean EXCEPT paste the last thing selected? This is a fundamental and essential function.
Last edited by ioerror; 05-02-2006 at 10:18 AM.
|
|
|
05-02-2006, 10:44 AM
|
#6
|
Member
Registered: Jul 2005
Location: Minneapolis, Minnesota
Distribution: Ubuntu
Posts: 35
Original Poster
Rep:
|
Quote:
What do you mean EXCEPT paste the last thing selected? This is a fundamental and essential function.
|
This to me seems like an opinion held by many linux users, but merely an opinion. If you can illustrate the neccesity of this function I would apreciate it.
Do programs actually get this mouse event, or does X-windows translate it to keystrokes? I would think the latter but mozilla uses the middle mouse button, albeit that mozilla uses the information in the "X-clipboard" to do a "I'm feeling lucky" search.
thanks again,
Florian
|
|
|
05-02-2006, 10:55 AM
|
#7
|
Member
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536
Rep:
|
Quote:
This to me seems like an opinion held by many linux users, but merely an opinion. If you can illustrate the neccesity of this function I would apreciate it.
|
Well, I use it maybe a hundred+ times a day. This is the primary mechanism in X for transerring data (text) from one app to another (simple example: I might select a phrase in your post, open a new tab and paste that phrase into a google search). I don't see how you could use X without it (well, except with lots of tedious, repetitive typing).
Quote:
Do programs actually get this mouse event, or does X-windows translate it to keystrokes?
|
Yes, the app receives the mouse event, and it's up to the app to request the selection from whatever app is the current owner. It is the responsibility of the apps to do the transer, the X server merely acts as a conduit.
Last edited by ioerror; 05-02-2006 at 10:58 AM.
|
|
|
05-02-2006, 12:23 PM
|
#8
|
Member
Registered: Jul 2005
Location: Minneapolis, Minnesota
Distribution: Ubuntu
Posts: 35
Original Poster
Rep:
|
Thanks, I see. Using ctrl-c and ctrl-v comes automatically to me and seems to work fine for all of the programs I use. I remember having issues with this ~5 years ago when I tried linux for the first time, but those issues seem to have been, for the most part, resolved. I guess this disscussion is beside the point, since this functionality is a useful feature that can be circumvented by rearanging the mouse buttons with xmodmap.
So, let's say I have a 7 button mouse (standard + thumb and pinky buttons). How would I use my thumb button(6) move a window? Should this be defined by gnome? I like gnome, but seems to be lacking in configurability. Would it be possible to use KDE's keyboard mapper* instead?
*keyboard mapper - I'm pretty shure this is the correct term, but correct me if I am mistaken
thanks again,
Florian
|
|
|
05-02-2006, 01:31 PM
|
#9
|
Member
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536
Rep:
|
Quote:
Using ctrl-c and ctrl-v comes automatically to me and seems to work fine for all of the programs I use.
|
Heh, I've never used these keys for cut/paste, I find it weird in OpenOffice and other apps that use this combination. But X doesn't care; as you say, you can configure it any way you like, as long as the apps can support what you want to do.
Quote:
So, let's say I have a 7 button mouse (standard + thumb and pinky buttons). How would I use my thumb button(6) move a window?
|
I'm pretty sure that X currently only supports 5 buttons (3 + wheel), though I'm still using 6.8.1 and 6.8.2, this may have changed with Xorg 7.0 (I hope so, I have an 8 button mouse and I want to use the extra buttons).
As for your question, as long as the buttons are supported by X, then you can do whatever you want with them. But as to whether the window manager can bind that button to a particular function is another question. I'm not that familiar with KDE so I don't know if it can do that.
edit:
From /usr/include/X11/X.h:
Quote:
#define Button1 1
#define Button2 2
#define Button3 3
#define Button4 4
#define Button5 5
|
Only five buttons exist so that's all you get. This is from Xorg 6.8.1.
Note that this is an X issue, the kernel supports more buttons.
Last edited by ioerror; 05-02-2006 at 01:42 PM.
|
|
|
05-02-2006, 03:39 PM
|
#10
|
Member
Registered: Jul 2005
Location: Minneapolis, Minnesota
Distribution: Ubuntu
Posts: 35
Original Poster
Rep:
|
Quote:
I'm pretty sure that X currently only supports 5 buttons (3 + wheel)
|
In the config files buttons 4 and 5 are the wheel and additional buttons start at 6. Poking around on the internet, it seems as if X now supports all those fancy buttons, but not usually without pulling up some config files...
http://gentoo-wiki.com/HOWTO_Mouse_Nav_Buttons
thank you for taking the time to respond to my questions,
Florian
|
|
|
05-03-2006, 03:37 AM
|
#11
|
Member
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536
Rep:
|
About time. Looks like support was added in 6.9 as far as I can tell. That link mentions imwheel, which I haven't used for years, shouldn't be needed with X7.0.
|
|
|
All times are GMT -5. The time now is 10:01 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|