How to change keybinding of mpv player?
Solution 1:
Follow these steps:
- Make a file
input.conf
inside~/.config/mpv
-
Open the file and add these lines:
UP add volume +2 DOWN add volume -2
Solution 2:
To extend on Arun's answer, it is also possible to modify other keys to other actions, for most of the keyboard keys it's as straightforward as:
[key] [action]
Where [key] is the key you want (case sensitive) and [action] is the action you want the player to do, where this page contains the full default config file, which has all the actions you can do, I couldn't find a place with the actions listed though, so it is possible it supports more actions.
For other keys however, especially non-standard keys you might need to run mpv with the flags:
--input-test --force-window --idle
Which will make mpv create a window that behaves like xev (although more user friendly since it shows the name of the key you pressed on screen).
This way you can then see which keys you are pressing, this is especially useful for when you're configuring the mouse with extra buttons, as some buttons may have special names in mpv.
Here is a small table of the actions from what I saw in the config file, if anyone finds somewhere with the full action list, I'll replace this with a link to there.
I have found a link to the full list/guide, but I'll leave this here as a quick lookup, the link was in here but I had just missed it.
(..) is mandatory [..] is optional ┌────────────────┬───────────────────────────────────────────────┬─────────────────────────────────────────────────────────────────────────────────────────────┐ │ Function │ Command │ Details │ ├────────────────┼───────────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────────────────────────┤ │ Volume Control │ add volume (x) │ (x) is the signed amount to add total volume │ │ Seeking │ [no-osd] [sub-]seek (x) [exact] │ (x) is the signed amount of seconds to seek │ │ │ │ "no-osd" can be added at the beginning to make the osd not show up │ │ │ │ "exact" can be added after to make the seek exact │ │ │ │ "sub-" makes the seek go [x] subtitle entries instead of seconds │ │ Video Panning │ video-pan-(direction) (x) │ (direction) is either 'x' or 'y' and (x) is the amount to move │ │ Video Zoom │ video-zoom (x) │ (x) is the amount to zoom │ │ Video Speed │ (multiply)(set) speed [1/](x) │ (x) is the amount to scale, and you can add [1/] before to make fractions easier │ │ Exit │ quit[-watch-later] │ Exits the video, [-watch-later] is an option, but I'm not sure what it does │ │ Frame Seek │ frame[-back]-step │ If [-back] isn't specified, it goes one frame ahead and pauses, else it goes 1 frame behind │ │ Pausing │ [cycle] pause │ If [cycle] is specified, it toggles the current status, else it just pauses │ │ Playlist │ playlist(-next)(-prev) │ Only either can be specified, not both nor neither │ │ Show Progress │ show-progress │ │ │ Set fullscreen │ set fullscreen (no)(yes) │ Only either │ │ Screen Mods │ add (contrast)(brightness)(gamma)(saturation) │ │ └────────────────┴───────────────────────────────────────────────┴─────────────────────────────────────────────────────────────────────────────────────────────┘ There are more, but I figured this made a list of the most common needed ones.
(If you are wondering why I'm responding to a year old question, it's that I couldn't find the answer myself on here, but this was the first question that popped up when I searched it, so I figured anyone looking at this question might also wonder how to change all the other keys too)