17

I have a problem with my Kali installation. Since I have updated it today, the mouse scrolling is inverted.

I have tried the .Xmodmap method and also checking 'natural scroll' option but without success.

How do I restore the previous scroll direction? Or differently put, how can I toggle between 'natural scrolling' and 'reverse scrolling', inverting the current settings?

AdminBee
  • 21,637
  • 21
  • 47
  • 71
Zack
  • 199
  • 1
  • 1
  • 7
  • [Here's how to do that via GUI in Linux Mint](https://www.technipages.com/linux-mint-invert-scroll-direction). You can also consider [this askubuntu Q/A](https://askubuntu.com/q/604002/830570) or [this one](https://askubuntu.com/q/91426/830570). There was a meta post on how to improve the question [here](https://unix.meta.stackexchange.com/q/7100/318461). – Cadoiz Jun 22 '23 at 06:28

6 Answers6

22

This seemed to be what i was looking for: How to *disable* natural scrolling?... enter this at the command line:

    gsettings set org.gnome.desktop.peripherals.mouse natural-scroll false
    gsettings set org.gnome.desktop.peripherals.touchpad natural-scroll false
jknox
  • 321
  • 1
  • 3
3

I auto - answer to me, I find a solution that works. Invert mouse scroll wheel in debian

I have edit the /usr/share/X11/xorg.conf.d/10-evdev.conf file to add

Option "ButtonMapping" "1 2 3 5 4 6 7 8"

And restart X server.

Cadoiz
  • 268
  • 1
  • 11
Zack
  • 199
  • 1
  • 1
  • 7
  • You have to use xorg, not wayland for this. Verify with `echo $XDG_SESSION_TYPE` (giving `x11`) - and pay attention to a capital first x at `X11`, – Cadoiz Jun 21 '22 at 23:01
  • Here is [how to restart the X server](https://askubuntu.com/a/1222/830570) – Cadoiz Jun 21 '22 at 23:16
3

To add on to jknox and JoorDaddee's answers (and to address papaiatis's concern):

Turning off "Natural Scrolling" in the settings didn't work for me, and neither did running gsettings set org.gnome.desktop.peripherals.mouse natural-scroll false, since both were already disabled.

What worked for me is running gsettings set org.gnome.desktop.peripherals.touchpad natural-scroll false. This fixed both the mouse and the touchpad (unplugging the mouse and plugging it back in made it work if it didn't apply immediately).

To be clear, I'm running Kali in VirtualBox, so I'm not sure if this applies otherwise. Then again, the OP didn't specify what environment he's running Kali in.

Cadoiz
  • 268
  • 1
  • 11
rom58
  • 39
  • 2
1

After a long journey and no answer, this thread brought me into the correct direction.

  1. Type xinput --list --short | grep pointer into your terminal to get the device name and id of the desired pointer (works for both mice and touchpads). Sample output:
⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ SynPS/2 Synaptics TouchPad                id=12   [slave  pointer  (2)]
⎜   ↳ lircd-uinput                              id=14   [slave  pointer  (2)]
⎜   ↳ Logitech MX Vertical Advanced Ergonomic Mouse Consumer Control    id=25   [slave  pointer  (2)]
⎜   ↳ Logitech MX Vertical Advanced Ergonomic Mouse id=26   [slave  pointer  (2)]

In my case, I wanted to change SynPS/2 Synaptics TouchPad with id=12.

  1. Now I typed the command xinput --list-props 12 (you could also paste it's name instead of the id 12) to get:
Device 'SynPS/2 Synaptics TouchPad':
    Device Enabled (183):   1
    Coordinate Transformation Matrix (185): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
    Device Accel Profile (312): 1
    Device Accel Constant Deceleration (313):   2.500000
    Device Accel Adaptive Deceleration (314):   1.000000
    Device Accel Velocity Scaling (315):    12.500000
    Synaptics Edges (316):  1659, 5337, 1531, 4401
    Synaptics Finger (317): 25, 30, 0
    Synaptics Tap Time (318):   180
    Synaptics Tap Move (319):   238
    Synaptics Tap Durations (320):  180, 180, 100
    Synaptics ClickPad (321):   1
    Synaptics Middle Button Timeout (322):  0
    Synaptics Two-Finger Pressure (323):    282
    Synaptics Two-Finger Width (324):   7
    Synaptics Scrolling Distance (325): -108, 108
    Synaptics Edge Scrolling (326): 1, 0, 0
    Synaptics Two-Finger Scrolling (327):   1, 0
    Synaptics Move Speed (328): 1.000000, 1.750000, 0.036880, 0.000000
    Synaptics Off (329):    0
    Synaptics Locked Drags (330):   0
    Synaptics Locked Drags Timeout (331):   5000
    Synaptics Tap Action (332): 2, 3, 0, 0, 1, 3, 0
    Synaptics Click Action (333):   1, 3, 0
    Synaptics Circular Scrolling (334): 0
    Synaptics Circular Scrolling Distance (335):    0.100000
    Synaptics Circular Scrolling Trigger (336): 0
    Synaptics Circular Pad (337):   0
    Synaptics Palm Detection (338): 0
    Synaptics Palm Dimensions (339):    10, 200
    Synaptics Coasting Speed (340): 20.000000, 50.000000
    Synaptics Pressure Motion (341):    30, 160
    Synaptics Pressure Motion Factor (342): 1.000000, 1.000000
    Synaptics Resolution Detect (343):  1
    Synaptics Grab Event Device (344):  0
    Synaptics Gestures (345):   1
    Synaptics Capabilities (346):   1, 0, 0, 1, 1, 1, 1
    Synaptics Pad Resolution (347): 53, 36
    Synaptics Area (348):   0, 0, 0, 0
    Synaptics Soft Button Areas (349):  3498, 0, 4033, 0, 0, 0, 0, 0
    Synaptics Noise Cancellation (350): 27, 27
    Device Product ID (306):    2, 7
    Device Node (307):  "/dev/input/event6"

I could also, but didn't want to change Device Accel Constant Deceleration, the interesting thing here was xinput --list-props 12 | grep 'Synaptics Scrolling Distance' (if you use a different driver, you might want to find something similarly adequate to Synaptics Scrolling Distance).

  1. In the last step, I inverted the vertical scroll direction by putting -108 instead of 108, leaving the absolute values unchanged. The final command is then xinput --set-prop 12 325 -108, 108

Notes:

  • instead of 12 325, you will probably need values specific to your setup
  • as far as I'm concerned, this method might be limited to OSes using Xorg aka the x server - some Ubuntu for example use wayland instead. To check, you can use echo $XDG_SESSION_TYPE, "if you see X11, it’s Xorg. If you see Wayland, quite obviously, the display server in use is Wayland."(formatting by me)
  • usually, the changes should apply immedeately, but if not, you can restart the x server. To do so, enter sudo systemctl restart display-manager, but beware that this kills all your graphical interfaces and probably loggs you off!
Cadoiz
  • 268
  • 1
  • 11
  • Just to add some more experience: on `5.15.48-1-MANJARO`, you cann't tweak neither `Device Accel Constant Deceleration`, nor `Synaptics Scrolling Distance`, but instead I used **`libinput Natural Scrolling Enabled (320)`**. I could (untested) probably also have used `libinput Scrolling Pixel Distance (338)` with a negative distance analogous as in my answer. The difference seems to be the pointer driver, *libinput* here instead of *Synaptics*. You can work it through exactly like in the answer using commands 1, 2, 3 with 3 being adjusted to `xinput --set-prop 11 320 1`. – Cadoiz Jul 18 '22 at 08:52
  • 1
    I'm using FVWM, so trying to stay away from GNOME and KDE specific fixed. This one worked for me, but my device was "ELAN0787:00 04F3:321A Touchpad" rather than the Synaptics one in the answer above, and it used "libinput Natural Scrolling Enabled" like the previous comment. Oddly enough, this laptop seems to have the directions reversed to most every other touchpad I've used, so "enabling" natural scrolling actually had the opposite effect (which is what I wanted). – DarkMoon Feb 23 '23 at 00:38
0

Or you could have just clicked on the down arrow by the time selected Settings(tools icon on left). Click on Mouse & Touchpad and turned off "Natural Scrolling"

0

Try this: enter about:config into the Firefox address bar (confirm the info message in case it shows up) and search for the preference named mousewheel.default.delta_multiplier_y. Double-click it and change its value to -100.

peterh
  • 9,488
  • 16
  • 59
  • 88