LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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


Reply
  Search this Thread
Old 05-01-2006, 06:25 PM   #1
mynameisflorian
Member
 
Registered: Jul 2005
Location: Minneapolis, Minnesota
Distribution: Ubuntu
Posts: 35

Rep: Reputation: 15
Question 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
 
Old 05-02-2006, 03:47 AM   #2
Jaqui
Member
 
Registered: Jan 2006
Location: Vancouver BC
Distribution: LFS, SLak, Gentoo, Debian
Posts: 291

Rep: Reputation: 36
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.
 
Old 05-02-2006, 10:08 AM   #3
ioerror
Member
 
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536

Rep: Reputation: 32
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.
 
Old 05-02-2006, 10:10 AM   #4
mynameisflorian
Member
 
Registered: Jul 2005
Location: Minneapolis, Minnesota
Distribution: Ubuntu
Posts: 35

Original Poster
Rep: Reputation: 15
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...
 
Old 05-02-2006, 10:16 AM   #5
ioerror
Member
 
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536

Rep: Reputation: 32
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.
 
Old 05-02-2006, 10:44 AM   #6
mynameisflorian
Member
 
Registered: Jul 2005
Location: Minneapolis, Minnesota
Distribution: Ubuntu
Posts: 35

Original Poster
Rep: Reputation: 15
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
 
Old 05-02-2006, 10:55 AM   #7
ioerror
Member
 
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536

Rep: Reputation: 32
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.
 
Old 05-02-2006, 12:23 PM   #8
mynameisflorian
Member
 
Registered: Jul 2005
Location: Minneapolis, Minnesota
Distribution: Ubuntu
Posts: 35

Original Poster
Rep: Reputation: 15
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
 
Old 05-02-2006, 01:31 PM   #9
ioerror
Member
 
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536

Rep: Reputation: 32
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.
 
Old 05-02-2006, 03:39 PM   #10
mynameisflorian
Member
 
Registered: Jul 2005
Location: Minneapolis, Minnesota
Distribution: Ubuntu
Posts: 35

Original Poster
Rep: Reputation: 15
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
 
Old 05-03-2006, 03:37 AM   #11
ioerror
Member
 
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536

Rep: Reputation: 32
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.
 
  


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
Panning with middle mouse button dotancohen Linux - Newbie 2 02-18-2005 05:02 PM
config middle mouse button has wheel function colorLinux Linux - Hardware 1 07-21-2004 01:42 PM
middle mouse button FLOODS Linux - Hardware 5 07-18-2004 05:54 AM
Mouse (middle scroller button) podollb Linux - Hardware 2 04-26-2004 07:29 AM
middle mouse button is paste.. but what if i dont have a mid mouse button? kublador Linux - Newbie 4 09-02-2003 08:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:47 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