Score:2

How to disable scroll wheel on Ubuntu?

bv flag

my mouse's scroll wheel has a mind of its own and I'd like to disable it, I've tried searching online but only found outdated posts. My version of Ubuntu is 22.04 LTS with X11. If possible I'd also like to remap my mouse's side buttons to scroll up and down. How can I do this? If possible using AutoKey I'd like someone to explain to me how to use it because I have no idea.

Score:1
in flag

Unfortunately ubuntu does not have a GUI option to configure the mouse scroll speed.

One way to do it is to:

  1. install imwheel, by running:

    sudo apt install imwheel

  2. use the script from www.nicknorton.net/mousewheel.sh:

    Run it in terminal: bash <(curl -s http://www.nicknorton.net/mousewheel.sh)

or create it first

#!/bin/bash
# Version 0.1 Tuesday, 07 May 2013
# Comments and complaints http://www.nicknorton.net
# GUI for mouse wheel speed using imwheel in Gnome
# imwheel needs to be installed for this script to work
# sudo apt-get install imwheel
# Pretty much hard wired to only use a mouse with
# left, right and wheel in the middle.
# If you have a mouse with complications or special needs,
# use the command xev to find what your wheel does.
#
### see if imwheel config exists, if not create it ###
if [ ! -f ~/.imwheelrc ]
then

cat >~/.imwheelrc<<EOF
".*"
None,      Up,   Button4, 1
None,      Down, Button5, 1
Control_L, Up,   Control_L|Button4
Control_L, Down, Control_L|Button5
Shift_L,   Up,   Shift_L|Button4
Shift_L,   Down, Shift_L|Button5
EOF

fi
##########################################################

CURRENT_VALUE=$(awk -F 'Button4,' '{print $2}' ~/.imwheelrc)

NEW_VALUE=$(zenity --scale --window-icon=info --ok-label=Apply --title="Wheelies" --text "Mouse wheel speed:" --min-value=1 --max-value=100 --value="$CURRENT_VALUE" --step 1)

if [ "$NEW_VALUE" == "" ];
then exit 0
fi

sed -i "s/\($TARGET_KEY *Button4, *\).*/\1$NEW_VALUE/" ~/.imwheelrc # find  the string Button4, and write new value.
sed -i "s/\($TARGET_KEY *Button5, *\).*/\1$NEW_VALUE/" ~/.imwheelrc # find the string Button5, and write new value.

cat ~/.imwheelrc
imwheel -kill

Note that

Pretty much hard wired to only use a mouse with left, right and wheel in the middle. If you have a mouse with complications or special needs, use the command xev to find what your wheel does.

Reference

https://linuxhint.com/change-mouse-scroll-speed-ubuntu/

cn flag
Joe
You might be able to make whatever keypress/sequence the mouse wheel generates into an AutoKey hotkey that does nothing, but this answer looks like it would be a much better solution.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.