mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
28.02k stars 2.88k forks source link

Feature: Please include built-in hotkeys in an included default input.conf, with other possible functions commented out #14868

Open TreeBranches opened 2 weeks ago

TreeBranches commented 2 weeks ago

Expected behavior of the wanted feature

By default, at least on Windows and MacOS, there is no input.conf anywhere, so after doing further reading you have to make one (and its location isn't clear as it doesn't account for portable installs, for example).

Additionally there are some hotkeys "built in" to MPV, which needs separate reading to find and discover.

A nice QOL feature would be to just include an input.conf with the application, in a location where mpv will look for it (so I assume .\mpv\input.conf will do), with enabled functions and hotkeys listed and available ones commented out.

I am aware that it's possible to list supported keys in mpv, but bonus points if somewhere in the input.conf there's a list of supported keys, so that questions like "how can I make ` or CAPS LOCK a hotkey?", or "Will my hotkeys override the built in ones?", or "How do I change existing hotkeys?" can get answered without having to scour documentation.

Alternative behavior of the wanted feature

No response

Log File

No response

Sample Files

No response

norinoriko commented 2 weeks ago

The input.conf that mpv comes built-in with is here https://github.com/mpv-player/mpv/blob/master/etc/input.conf. You can just download it and add it to your own config directory if the goal here is to see all of the default bindings in a text editor. There's also --input-keylist and --input-test if you just want to see the key names for special or unbound keys.

TreeBranches commented 1 week ago

The input.conf that mpv comes built-in with is here https://github.com/mpv-player/mpv/blob/master/etc/input.conf. You can just download it and add it to your own config directory if the goal here is to see all of the default bindings in a text editor. There's also --input-keylist and --input-test if you just want to see the key names for special or unbound keys.

But this is specifically what my request is about.

I feel that having hotkeys completely baked into the binary so completely isn't particularly useful or convenient for anyone. It requires separate research to discover not only what they are but what's available to use (ie, I need to either look up online to see what the hotkeys are, or I need to lookup what command switches are used to both see what keys are possible or what commands are possible)

From what I understand, in order to disable any hotkeys, I need to launch mpv with the --no-input-default-bindings parameter, and then I need to uncomment all of the ones I actually want to use? This also isn't a solution for anyone opening a video file from a GUI file explorer directly.

What I'm proposing seems to be a lot simplier;

All hotkeys pulled from a bundled input.conf so that any unwanted hotkeys can easily be commented out/removed by the user, but also have all options and possibilities available to them in a single editable file.

llyyr commented 1 week ago

I feel that having hotkeys completely baked into the binary so completely isn't particularly useful or convenient for anyone. It requires separate research to discover not only what they are but what's available to use

The /etc/input.conf file should be part of the mpv package on whatever distro you're on, you can look it up there. You can also do man mpv to look up the manual without internet.

From what I understand, in order to disable any hotkeys, I need to launch mpv with the --no-input-default-bindings parameter, and then I need to uncomment all of the ones I actually want to use? This also isn't a solution for anyone opening a video file from a GUI file explorer directly.

Why is it not viable when launching from a file explorer? If that's what you want to do then set input-default-bindings=no in your mpv.conf file and set the input.conf however you want.

All hotkeys pulled from a bundled input.conf so that any unwanted hotkeys can easily be commented out/removed by the user, but also have all options and possibilities available to them in a single editable file.

This doesn't work because package managers can't install files in your XDG_CONFIG_HOME, so the the default key binds would need to be in a system-wide directory so they can be installed by your package manager. This just results in a worse out-of-box experience for mpv users, I don't understand the benefits.

avih commented 1 week ago

There's also --input-keylist and --input-test if you just want to see the key names for special or unbound keys.

Those are indeed useful to check the names which one can bound to command (--input-keylist), and test whether any specific key-combo is bound to anything (--input-test).

But there are also ways to list all the bindings:

You can press I (SHIFT+i) to activate the interactive stats.lua page, then press 4 to display the active-keybindings page (scroll with UP/DOWN arrows, search with /). This works both in the mpv window or in the terminal (even if there's no window), e.g. after running mpv --idle. Press SHIFT+i again to deactivate the stats page.

As the Active-keybindings link documents, you can also list all the key bindings at the terminal, non-interactively, using:

mpv --idle --script-opts=stats-bindlist=yes

This list also includes bindings from your input.conf. If you want to see the default bindings only, then add --no-config.

You can copy any line from there into your input.conf file, and change it there as you see fit.