Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

HOWTO turn mice wheels off

Share your HowTo, Documentation, Tips and Tricks. Not for support questions!.
Post Reply
Message
Author
User avatar
Meow
Posts: 29
Joined: 2015-04-13 23:32
Has thanked: 5 times

HOWTO turn mice wheels off

#1 Post by Meow »

Cat hair and other dirt tend to make mouse wheels over-sensitive.
This in turn makes the middle mouse button unusable.

This HOWTO describes a script to turn off the wheels conveniently.

This HOWTO requires intermediate skills on your part:
-Knowledge how to save files, how to chmod them executable and how to call them from your personal startup file

Code: Select all

#!/usr/bin/perl
use strict;

# make sure you installed xinput - not default in some distros

# get output of "xinput list"
my $xinp = `xinput list`;
# get the mice id
(my @mida) = $xinp =~ /^.*\s+id=(\d)\s+\[slave\s+pointer.*$/gm;
foreach my $mid (@mida) {
  # now get info for this mouse device
  $xinp = `xinput list $mid`;
  # get the information in the "Button labels" line
  (my $bl) = $xinp =~ /^\s+Button labels:\s(.*)$/gm;
  # separate the button descriptions
  # if there are any unparenthesized "None" in the file, escape them
  $bl =~ s/None/"None"/g;
  my @btnt = split(/\"\s\"/, $bl);
  # now get the button map
  my @bmap = split(' ', `xinput get-button-map $mid`);
  # build the command string to be executed
  my $cmd = "xinput set-button-map $mid";
  for (my $bid = 0; $bid < scalar @bmap; $bid++) {
    $cmd .= ' ' . ($btnt[$bid] =~ /.*Wheel.*/ ? '0' : $bmap[$bid]);
  }
  # finally turn off the wheels :)
  `$cmd`;
}
Make sure that xinput is installed (quickly done using synaptic).
Copy this code, make it executable and modify your startup so that it is executed at each system start.
And bingo, no more annoying wheel scrolling!

User avatar
mardybear
Posts: 994
Joined: 2014-01-19 03:30

Re: HOWTO turn mice wheels off

#2 Post by mardybear »

Meow wrote:Cat hair and other dirt tend to make mouse wheels over-sensitive.
This in turn makes the middle mouse button unusable.
This HOWTO describes a script to turn off the wheels conveniently.
And bingo, no more annoying wheel scrolling!
Why would you want to disable the functionality of mouse scrolling?
Wouldn't it be easier just to clean your mouse?
800mhz, 512mb ram, dCore-jessie (Tiny Core with Debian Jessie packages) with BusyBox and Fluxbox.
Most don't have computer access, reuse or pay forward an old computer.

User avatar
Meow
Posts: 29
Joined: 2015-04-13 23:32
Has thanked: 5 times

Re: HOWTO turn mice wheels off

#3 Post by Meow »

mardybear wrote:Wouldn't it be easier just to clean your mouse?
I did... I have piled up four mice over time due to this. Cleaning the movement sensor when the mouse movement gets jerky due to cat hair is quite easy. I am routined in opening and cleaning mice. The bad thing is the delicate scroll wheel mechanism that is very hard to clean.. If it gets dirty, you can (erratically) scroll by just moving the mouse. Cleaning reduces this to a *very* sensitive mouse wheel. Just touching the wheel can make scroll.
I am just fed up of piling up more mice just because of that useless scroll wheel. I prefer to scroll using keys or the bars anyway. So I wrote that script..

Post Reply