LinuxQuestions.org
Register a domain and help support LQ
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 05-13-2008, 09:57 PM   #1
virgin
Member
 
Registered: Jun 2003
Location: Pgh, PA
Distribution: debian
Posts: 50

Rep: Reputation: 15
How to remap/disable right click


Dear All:

I would like to know how to remap right clicking on my debian machine.

Totally disabling the thing would be ok, although remapping it to ctrl-right-click or ctrl-left-click (while still having the right click button by itself do nothing) would be best.

I have a feeling this problem will be solved in xorg.conf, but if I knew how to do it you might be reading something else.

I looked at other similar posts, and changing "Emulate3Buttons" to "no" and "Buttons" to "1" doesn't seem to even disable the right click.

I am using blackbox, not sure if that is relevant.

My reason, in case that matters, is that my two-year old is a primary user. We have an old-school two-button mouse, but what happens when the right button is clicked is a little frustrating for someone just getting the swing of things.

I don't want to buy a one-button mouse, and if parenting philosophy is the only solution, this thread will have to be moved to general.

Thinking over this post, I realize that what would be very cool, and that what I really want is to be to be able to use a two-button or more complicated mouse (with roller or many buttons) where the roller, right-click, or third button only worked with ctrl depressed. Hopefully the solution to this problem can be generalized.

Thanks in advance,

V
 
Old 05-14-2008, 09:56 PM   #2
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,185

Rep: Reputation: 52
if you can't figure it out, get the kid his own cheap mouse, take it apart, and cut off the plastic knob that pushes down the second contact.
 
Old 05-14-2008, 11:22 PM   #3
virgin
Member
 
Registered: Jun 2003
Location: Pgh, PA
Distribution: debian
Posts: 50

Original Poster
Rep: Reputation: 15
Thanks, but that solution seems to me to be equivalent to buying a one-button mouse.

I would like to at least know if an elegant solution exists.

Has anyone done anything like this? Do you know why my right click still works with:

Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "CorePointer"
Option "Device" "/dev/input/mice"
Option "Protocol" "ImPS/2"
Option "Buttons" "1"
Option "Emulate3Buttons" "no"
EndSection
?
 
Old 05-18-2008, 10:13 AM   #4
virgin
Member
 
Registered: Jun 2003
Location: Pgh, PA
Distribution: debian
Posts: 50

Original Poster
Rep: Reputation: 15
Is there really no way to make the right click button only work with ctrl depressed?
 
Old 05-18-2008, 10:38 AM   #5
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,185

Rep: Reputation: 52
i was just looking at the linux kernel source code, linux/drivers/input/mousedev.c, and it looks like if you changed the index number of case BTN 1: or removed the break, or played with other things, you could make happen what you want to happen.

static void mousedev_key_event(struct mousedev *mousedev,
unsigned int code, int value)
{
int index;
switch (code) {
case BTN_TOUCH:
case BTN_0:
case BTN_LEFT: index = 0; break;
case BTN_STYLUS:
case BTN_1:
case BTN_RIGHT: index = 1; break;
case BTN_2:
case BTN_FORWARD:
case BTN_STYLUS2:
case BTN_MIDDLE: index = 2; break;
case BTN_3:
case BTN_BACK:
case BTN_SIDE: index = 3; break;
case BTN_4:
case BTN_EXTRA: index = 4; break;
 
Old 05-18-2008, 11:09 AM   #6
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,185

Rep: Reputation: 52
yeah. I changed the following line:


case BTN_RIGHT: index = 1; break;

to

case BTN_RIGHT: index = 0; break;

recompiled the kernel, and booted it, and the right mouse button did exactly the same thing as the left mouse button.
 
Old 05-18-2008, 11:30 AM   #7
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,185

Rep: Reputation: 52
I just dug through the blackbox code a little. It generally uses the variable Button, but i didn't run onto anything specific that i could understand quickly enough. It might be worthwhile for you to dig through that code.
 
Old 05-18-2008, 12:31 PM   #8
smoked kipper
Member
 
Registered: May 2008
Location: UK
Distribution: Slackware,Slamd64
Posts: 81

Rep: Reputation: 15
Just add, e.g.

Code:
Option  "ButtonMapping" "1 1 1"
to xorg.conf
 
Old 05-19-2008, 07:19 AM   #9
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 233Reputation: 233Reputation: 233
Quote:
Originally Posted by virgin View Post
Totally disabling the thing would be ok, although remapping it to ctrl-right-click or ctrl-left-click (while still having the right click button by itself do nothing) would be best.
. . .
Thinking over this post, I realize that what would be very cool, and that what I really want is to be to be able to use a two-button or more complicated mouse (with roller or many buttons) where the roller, right-click, or third button only worked with ctrl depressed. Hopefully the solution to this problem can be generalized.
Looks like the base goal can be realized in more than one way, can "only worked with ctrl depressed" be realized? (I hope I didn't misunderstand any of the 3 proposed solutions.)
 
Old 05-19-2008, 07:35 AM   #10
Mohtek
Member
 
Registered: Dec 2004
Location: Denver Colorado
Distribution: Kubuntu/Debian
Posts: 120

Rep: Reputation: 15
I think there is another more apt solution

The whole dance of fine (finger control) and gross (arm control) is very difficult for small children.

You could look into alternative input devices including a 1 button mouse, such as the Kensington 64475 Mouse-in-a-Box USB/ADB Mouse (PC/Mac) (Amazon.com). Other options include trackballs etc.

I saw something a few years back...it looked like a big yellow ball that required the whole hand to move, and a giant button on the front. I think that would be ideal, but I'm not sure what it's called

I am a firm believer that assisted technology can also be used to help the younger children use the computer as well.

Well, my 2 cents anyway
 
Old 05-19-2008, 08:09 AM   #11
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
I highly doubt that you can achieve this, unless you dive not only in the blackbox code, but also in the code for every application that you will be using. I mean, the blackbox domain ends when you enter the client portion of a given window, and blackbox can't do anything about how each program behaves.

I bet that you can disable the second button, though I never did it, but I doubt that you can disable it generally but enable it when using ctrl.

I could advise you to buy 1 mouse buttons, but remember that hiding a problem doesn't make it disappear. Most applications will assume that you have two working mouse buttons or a way to emulate them. That's not a problem if you only use custom programs though.
 
  


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
Disable Right Click button for user jaredhanks Red Hat 5 11-23-2010 01:03 AM
How can I disable Mouse Right Click in KDE? steve_f60 Linux - Software 1 11-02-2005 02:48 PM
How to disable the right-click pop up menu? jpan Linux - General 2 09-16-2004 03:27 PM
How do I disable the Right Click function on the mouse??? steve_f60 Linux - General 6 07-21-2004 03:59 PM
how to disable right-click in konqueror? crewler Linux - Newbie 2 07-12-2004 03:47 PM


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