Mouse problem: how to disable scroll wheel acting like left mouse key?

Moderators: 666philb, Forum moderators

Post Reply
boof
Posts: 568
Joined: Sat Aug 15, 2020 9:17 am
Been thanked: 8 times

Mouse problem: how to disable scroll wheel acting like left mouse key?

Post by boof »

i have a cheap 2 button mouse with scroll wheel. when scroll wheel is pressed it acts like the left mouse button/enter key. when scrolling in a browser, it adds web pages to my browsers' top row, ultimately bogging my computer processor. can i disable this function whilst keeping the scroll wheel, even with an on screen toggle icon? i don't know if the signal is unique, or do i cut some wires in the mouse? pls advise. maxxter wireless optical mouse ACT MUS-002

boof
Posts: 568
Joined: Sat Aug 15, 2020 9:17 am
Been thanked: 8 times

Re: mouse problems.

Post by boof »

cannot turn scroll wheel off. keeps turning on.

boof
Posts: 568
Joined: Sat Aug 15, 2020 9:17 am
Been thanked: 8 times

Re: Mouse problem: how to disable scroll wheel acting like left mouse key?

Post by boof »

is there a puppy mouse driver/config file which allows 3rd mouse key to be disabled, even if exists?
whe n enter ue utton of, it just turns bc on aain how o i sto auto harwr update ps?

User avatar
bigpup
Moderator
Posts: 7031
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 925 times
Been thanked: 1535 times

Re: Mouse problem: how to disable scroll wheel acting like left mouse key?

Post by bigpup »

Is this on a desktop or laptop computer?

If laptop.

Is touchpad turned off?

Is this only in a browser or in any program you run?

If browser.

Firefox does the same thing for me.
Clicking Middle button (pressing down on the scroll wheel) acts like clicking left button.
firefox about:config settings control this.

The mouse cursor does need to be over something on the web page that would be clicked on.

The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

boof
Posts: 568
Joined: Sat Aug 15, 2020 9:17 am
Been thanked: 8 times

Re: Mouse problem: how to disable scroll wheel acting like left mouse key?

Post by boof »

i'm in chrome and ff.
happens in both.
somewhere there is a switchable auto new usb device detect. if i turn it off and clear the mouse middle button emulator flag, it might stay cleared, giving me what i want.
no touchpad.

User avatar
MochiMoppel
Posts: 1243
Joined: Mon Jun 15, 2020 6:25 am
Location: Japan
Has thanked: 21 times
Been thanked: 444 times

Re: Mouse problem: how to disable scroll wheel acting like left mouse key?

Post by MochiMoppel »

boof wrote: Sun Sep 17, 2023 1:54 pm

i have a cheap 2 button mouse with scroll wheel.

In other words: You have a 5 button mouse ;)

when scroll wheel is pressed it acts like the left mouse button/enter key.

Are you saying that when clicking on a link in this forum with the middle button the linked page opens in the same tab? With a correct middle button the link is supposed to open in a new tab. This would also mean that you can't use the middle button to paste a selected text.

when scrolling in a browser, it adds web pages to my browsers' top row, ultimately bogging my computer processor.

When scrolling up or when scrolling down? Or both? This suggests that your button 4 (scroll up) and button 5 (scroll down) are mapped to button 2 (middle button = your scroll wheel button) and that normal scrolling does not work anywhere.

can i disable this function whilst keeping the scroll wheel, even with an on screen toggle icon?

What is "this"? And what do you want to keep? A disabled scroll wheel? Why not fix "this"?

Let's try:

1) Firstly let's find your mouse ID. Open a terminal and enter the command xinput | grep -io "mouse.*id=.."

Code: Select all

# xinput | grep -io "mouse.*id=.."
Mouse	id=9

In my case the ID is 9, your's might be different. If the command did not work for you you can input just xinput. Look for the line that says "Mouse" and note the ID.

2) Now we need to find out, how the mouse keys are mapped:
With my mouse ID 9 I would enter xinput --get-button-map 9

Code: Select all

# xinput --get-button-map 9
1 2 3 4 5 0 0 

This is how a correct mouse map looks like (I don't have 7 buttons, so the last zeros don't matter see EDIT). If your middle button really acts like the left button, the sequence would be 1 1 3 .... and if your scrolling acts like a middle button (keeps opening new tabs when over a link) the sequence might be something like 1 1 3 2 2 . I hope you get the idea.

3) If the sequence found in step 2) is different from 1 2 3 4 5 .. then it can be fixed with the command xinput --set-button-map 9 1 2 3 4 5. Again, 9 is my ID. Replace it with the ID of your mouse. If all went well your mouse should work now correctly.
Of course you could also disable your scroll wheel completely and turn your 5 button mouse into a real 2 button mouse (sequence 1 0 3 0 0) :lol:

[EDIT]:Buttons 6 7 are buttons for horizontal scrolling. Though I don't have an extra scroll wheel for horizontal scrolling I could remap my existing scroll wheel so that ScrollUp becomes ScrollLeft and ScrollDown becomes ScrollRight (map sequence 1 2 3 6 7). Interesting but not terribly useful.

Last edited by MochiMoppel on Mon Sep 25, 2023 11:17 am, edited 1 time in total.
boof
Posts: 568
Joined: Sat Aug 15, 2020 9:17 am
Been thanked: 8 times

Re: Mouse problem: how to disable scroll wheel acting like left mouse key?

Post by boof »

Mouse id=10
Mouse Consumer Control id=11
Mouse id=14
Mouse Consumer Control id=15
Mouse System Control id=12
Mouse id=13
Mouse System Control id=16
Mouse Consumer Control id=18
Mouse Consumer Control id=19

root# # xinput --get-button-map
root# xinput --get-button-map
usage: xinput get-button-map <device name>
root# xinput --get-button-map 10
1 2 3 4 5 6 7 8 9

i have a working mouse, with scroll wheel.
i want to be easily toggle the middle button emulation.
ATM if i disable the scroll wheel, the system re-enables it. also, i don't have option to disable the middle key.
tried
xinput --set-button-map 10 14 12 13 16
xinput --set-button-map 11 1 2 0 4 5
nb appear to have disabled left and right mouse button menus, but center button working.
fixed by
xinput --set-button-map 10 1 2 3 4 5

xinput --set-button-map 10 1 0 3 4 5 - disables middle and left mouse button
input --set-button-map 10 1 1 3 4 5 -- no change.

boof
Posts: 568
Joined: Sat Aug 15, 2020 9:17 am
Been thanked: 8 times

Re: Mouse problem: how to disable scroll wheel acting like left mouse key?

Post by boof »

xinput --set-button-map 10 1 1 3 4 5

!# /bin.sh
if ((xinput --get-button-map 10) = {10 1 2 3 4 5 6 7 8 9});
(xinput --set-button-map 10 1 1 3 4 5);
(xinput --set-button-map 10 1 2 3 4 5)
fi
I don't know which one is for the middle mouse key. because it's still not working. i presume my if statement is correct
not sure what "mapping" does, does it assign the signal to the key of just the hardware to the presence of the key? I have 9 keys assigned to a mouse port, obviously for games too
using xbindkeys and xautomation, with comand <xev> and pressing scroll wheel i get this.

MapNotify event, serial 15, synthetic NO, window 0x4200001,
event 0x4200001, window 0x4200002, override NO as the only listed event that might mean something. i think the 15> is important, but i'm too tired to draw it together.

User avatar
MochiMoppel
Posts: 1243
Joined: Mon Jun 15, 2020 6:25 am
Location: Japan
Has thanked: 21 times
Been thanked: 444 times

Re: Mouse problem: how to disable scroll wheel acting like left mouse key?

Post by MochiMoppel »

boof wrote: Sat Sep 23, 2023 8:11 am

xinput --set-button-map 10 1 1 3 4 5

2 hours ago you posted "WORKS!!!" and that exactly this command obviously solved your problems. Now it doesn't ?

i presume my if statement is correct

No, it isn't. Pay attention to the error messages it produces! I can't even figure out what you are trying to achieve

but i'm too tired to draw it together.

So am I.

User avatar
stemsee
Posts: 782
Joined: Sun Jul 26, 2020 8:11 am
Location: lattitude 8
Has thanked: 186 times
Been thanked: 132 times

Re: Mouse problem: how to disable scroll wheel acting like left mouse key?

Post by stemsee »

Code: Select all

#!/bin/sh
if [[ $(xinput --get-button-map 10) = '1 2 3 4 5 6 7 8 9' ]]; then
xinput --set-button-map 10 1 1 3 4 5 6 7 8 9
else
xinput --set-button-map 10 1 2 3 4 5 6 7 8 9
fi
boof
Posts: 568
Joined: Sat Aug 15, 2020 9:17 am
Been thanked: 8 times

Re: Mouse problem: how to disable scroll wheel acting like left mouse key?

Post by boof »

thanks. that code looks better. i'm not sure the ~11345 works now, but now i havethecorrect code i'll test it latertoday.

boof
Posts: 568
Joined: Sat Aug 15, 2020 9:17 am
Been thanked: 8 times

Re: Mouse problem: how to disable scroll wheel acting like left mouse key?

Post by boof »

#! /bin/sh
if ((xinput --get-button-map 10) = {1 2 3 4 5 6 7 8 9}); then
(xinput --set-button-map 10 1 0 3 4 5 6 7 8 9);
else
(xinput --set-button-map 10 1 2 3 4 5 6 7 8 9);
fi

have i made the first set of digits as a string? do i need ; at the end of each line and each line bracketed?

i can't make the if statement work, so i have an on and off icon on my desktop. they work well,
but i'd like to have just one, and it toggle.

Burunduk
Posts: 257
Joined: Thu Jun 16, 2022 6:16 pm
Has thanked: 7 times
Been thanked: 127 times

Re: Mouse problem: how to disable scroll wheel acting like left mouse key?

Post by Burunduk »

boof wrote: Sat Sep 23, 2023 10:48 pm

have i made the first set of digits as a string?

No, a string can be quoted: 'string' or "string". Curly braces cannot be used as a string delimiters in bash.

do i need ; at the end of each line and each line bracketed?

No. It separates commands. You can omit it at the end of lines.

You have edited the stemsee's code unnecessarily. It's correct as it is, except that it doesn't work on my Fossapup64:
xinput --get-button-map returns a string that ends with a space, so it's never equal to the provided string (without a trailing space).

i'd like to have just one, and it toggle.

This should work:

Code: Select all

#!/bin/sh
if [[ $(xinput --get-button-map 10) =~ '1 2' ]]; then
xinput --set-button-map 10 1 1 3 4 5 6 7 8 9
else
xinput --set-button-map 10 1 2 3 4 5 6 7 8 9
fi

Or you can make it a bit shorter:

Code: Select all

#!/bin/sh
xinput --set-button-map 10 `xinput --get-button-map 10 | sed 's/ 2/ 1/;t;s/ 1/ 2/'`

Please consider to simply copy and paste one of the above snippets without editing a single character if you want to have better chances for it to work.

---
Edit: It seems the whole map is not needed to change just the first part of it. This also works:

Code: Select all

#!/bin/sh
if [[ $(xinput --get-button-map 10) =~ '1 2' ]]; then
xinput --set-button-map 10 1 1
else
xinput --set-button-map 10 1 2
fi
User avatar
stemsee
Posts: 782
Joined: Sun Jul 26, 2020 8:11 am
Location: lattitude 8
Has thanked: 186 times
Been thanked: 132 times

Re: Mouse problem: how to disable scroll wheel acting like left mouse key?

Post by stemsee »

Why doesn't remapping work with my touchscreen?

Code: Select all

# xinput --get-button-map 10
1 2 3 4 5 6 7 8 

I want the second touch , when first touch is also active, to imitate right mouse click.

Burunduk
Posts: 257
Joined: Thu Jun 16, 2022 6:16 pm
Has thanked: 7 times
Been thanked: 127 times

Re: Mouse problem: how to disable scroll wheel acting like left mouse key?

Post by Burunduk »

stemsee wrote: Mon Sep 25, 2023 1:57 am

Why doesn't remapping work with my touchscreen?

If you're asking me, I don't know. Remapping only shuffles the already configured buttons. Maybe run xinput --list-props <your_touchscreen_ID> to see what's available.

Overall, this is a long story and a real show stopper. At the moment, I haven't found a way to properly configure my touchpad with libinput in recent puppy builds and the default settings are terribly horrible.

I want the second touch , when first touch is also active, to imitate right mouse click.

Do you want to "move cursor to a clickable target then, without lifting the first finger, tap a second finger to click that target"? The issue stays open for a long time. So it may not be possible for now.

boof
Posts: 568
Joined: Sat Aug 15, 2020 9:17 am
Been thanked: 8 times

Re: Mouse problem: how to disable scroll wheel acting like left mouse key?

Post by boof »

WORKING FINAL VERSION -- MUCH THX TO ALL

Code: Select all

#!/bin/sh
if [[ $(xinput --get-button-map 10) =~ '1 2' ]]; then
xinput --set-button-map 10 1 0
else
xinput --set-button-map 10 1 2
fi

/end thread?

Last edited by rockedge on Sun Oct 01, 2023 12:22 am, edited 1 time in total.
Reason: added code block
Post Reply

Return to “Fossapup64”