How to Bind Mouse Scroll in mpv for Volume and Seeking?

Using the mpv media player, you can customize your mouse scroll wheel to control both volume adjustments and timeline seeking by modifying the input.conf configuration file. This article provides a step-by-step guide on how to locate or create this file, the exact command lines needed to bind WHEEL_UP and WHEEL_DOWN with modifiers like Ctrl or Shift, and how to save these changes to achieve a seamless playback experience.

Locating or Creating your input.conf File

Before adding custom keybindings, you need to navigate to the mpv configuration directory. The location varies depending on your operating system:

If you do not see an input.conf file in that folder, simply create a new plain text file and name it input.conf.

Configuration Lines for Volume and Seeking

Open your input.conf file in a text editor and paste the configuration that best fits your workflow.

By default, mpv uses the scroll wheel for seeking. If you want to use the standard scroll for volume and a modifier key (like Ctrl or Shift) for seeking, use one of the setups below.

Option 1: Scroll for Volume, Ctrl+Scroll for Seeking

# Scroll up and down to change volume
WHEEL_UP      add volume 2
WHEEL_DOWN    add volume -2

# Hold Ctrl and scroll to seek forward and backward
Ctrl+WHEEL_UP   seek 5
Ctrl+WHEEL_DOWN seek -5

Option 2: Scroll for Seeking, Shift+Scroll for Volume

# Scroll up and down to seek
WHEEL_UP      seek 5
WHEEL_DOWN    seek -5

# Hold Shift and scroll to change volume
Shift+WHEEL_UP   add volume 2
Shift+WHEEL_DOWN add volume -2

Customizing the Values

You can change the behavior of these shortcuts by editing the numbers at the end of each line:

Save the input.conf file and restart mpv to apply your new mouse scroll bindings.