Ubuntu – Ubuntu 18.04LTS – mouse scroll is just wrong

18.04mousemouse scrollxinput

I can't believe I've spent almost 2 hours looking for an answer to work for me – but I couln't find oune. I know this has been asked before numerous times – but no solution seems to work for my mouse (wireless Mouse + Keyboard (single dongle) by Microsoft).

The problem is that the scroll is way too fast, but when I remove and insert the dongle back, now the scroll is way too slow :(.

here's an input of xinput list short:

⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ Microsoft Microsoft® 2.4GHz Transceiver v7.0  id=9    [slave  pointer  (2)]
⎜   ↳ Microsoft Microsoft® 2.4GHz Transceiver v7.0  id=11   [slave  pointer  (2)]
⎣ Virtual core keyboard                     id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard (3)]
    ↳ Power Button                              id=7    [slave  keyboard (3)]
    ↳ Sleep Button                              id=8    [slave  keyboard (3)]
    ↳ Jabra Jabra UC VOICE 150a MS              id=12   [slave  keyboard (3)]
    ↳ Eee PC WMI hotkeys                        id=13   [slave  keyboard (3)]
    ↳ Microsoft Microsoft® 2.4GHz Transceiver v7.0  id=10   [slave  keyboard (3)]
    ↳ Microsoft Microsoft® 2.4GHz Transceiver v7.0  id=14   [slave  keyboard (3)]
    ↳ Microsoft Microsoft® 2.4GHz Transceiver v7.0  id=15   [slave  keyboard (3)]

and here's the input for:
xinput list-props 11:

Device 'Microsoft Microsoft® 2.4GHz Transceiver v7.0':
    Device Enabled (152):   1
    Coordinate Transformation Matrix (154): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
    libinput Natural Scrolling Enabled (288):   0
    libinput Natural Scrolling Enabled Default (289):   0
    libinput Scroll Methods Available (290):    0, 0, 1
    libinput Scroll Method Enabled (291):   0, 0, 1
    libinput Scroll Method Enabled Default (292):   0, 0, 0
    libinput Button Scrolling Button (293): 2
    libinput Button Scrolling Button Default (294): 2
    libinput Middle Emulation Enabled (295):    0
    libinput Middle Emulation Enabled Default (296):    0
    libinput Accel Speed (297): -0.007194
    libinput Accel Speed Default (298): 0.000000
    libinput Accel Profiles Available (299):    1, 1
    libinput Accel Profile Enabled (300):   1, 0
    libinput Accel Profile Enabled Default (301):   1, 0
    libinput Left Handed Enabled (302): 0
    libinput Left Handed Enabled Default (303): 0
    libinput Send Events Modes Available (273): 1, 0
    libinput Send Events Mode Enabled (274):    0, 0
    libinput Send Events Mode Enabled Default (275):    0, 0
    Device Node (276):  "/dev/input/event4"
    Device Product ID (277):    1118, 1861
    libinput Drag Lock Buttons (304):   <no items>
    libinput Horizontal Scroll Enabled (305):   1

now, as you can't see, there no:
'Device Accel Constant Deceleration', and also no
"Evdev Scrolling Distance"
which are some properties I've read that I should change in order to get what I wan't.

Needless to say that when I do as suggested in other answers I get:

$ xinput set-prop 11 "Evdev Scrolling Distance" 8 1 1

property 'Evdev Scrolling Distance' doesn't exist, you need to specify its type and forma

$xinput set-prop 11 'Device Accel Constant Deceleration' 3

property 'Device Accel Constant Deceleration' doesn't exist, you need
to specify its type and format.

I also tried to define these properties – but with no success. Please help me – this is driving me crazy.

Thanks.

Best Answer

I'm also having this problem. So far, this doesn't throw an error:

$ xinput --set-prop 17 --type=float --format=32 "Evdev Scrolling Distance" 1

But it doesn't actually change anything, at least for me. I'll keep trying...

Edit: I found the manpage for evdev here. I didn't glean enough from it to solve it. I'm sure it would be interesting to figure out another time, though.

In continuing to read, I found a little program called imwheel that works.

sudo apt install imwheel

Then create an rc file:

vim ~/.imwheelrc

".*"
None,      Up,   Button4, 7
None,      Down, Button5, 7
Control_L, Up,   Control_L|Button4
Control_L, Down, Control_L|Button5
Shift_L,   Up,   Shift_L|Button4
Shift_L,   Down, Shift_L|Button5

Where lines 2 and 3 end with '7', which is the scroll distance (default '3'). Try playing with it, just do imwheel --kill then imwheel to reload changes. The last four lines introduce standard behavior between shift/control and scrolling.

The full guide is here and has more info.