LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to remap/disable right click (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-remap-disable-right-click-642018/)

virgin 05-13-2008 08:57 PM

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

whansard 05-14-2008 08:56 PM

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.

virgin 05-14-2008 10:22 PM

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
?

virgin 05-18-2008 09:13 AM

Is there really no way to make the right click button only work with ctrl depressed?

whansard 05-18-2008 09:38 AM

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;

whansard 05-18-2008 10:09 AM

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.

whansard 05-18-2008 10:30 AM

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.

smoked kipper 05-18-2008 11:31 AM

Just add, e.g.

Code:

Option  "ButtonMapping" "1 1 1"
to xorg.conf

archtoad6 05-19-2008 06:19 AM

Quote:

Originally Posted by virgin (Post 3152433)
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.)

Mohtek 05-19-2008 06:35 AM

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

i92guboj 05-19-2008 07:09 AM

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.


All times are GMT -5. The time now is 03:21 PM.