mpv-player / mpv

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

enhance Active Key Bindings' filter #14966

Open VimWei opened 2 days ago

VimWei commented 2 days ago

Expected behavior of the wanted feature

Active Key Bindings's issue

Page 4 also binds / to search for input bindings by typing part of a binding or command. from https://mpv.io/manual/stable/#stats

Currently, if the filter results are too numerous to fit on a single page, there's no mechanism to browse through the remaining results.

Improvement Suggestions:

  1. Implement a Navigation Mechanism for Filter Results: Introduce a way to navigate through paginated filter results, potentially using modifier keys in combination with other shortcuts. For example:
  1. Enable Filtering of Comments: Allow users to filter items based on the content of their comments. This would be particularly helpful when defining keybindings in input.conf or similar configuration files. Users could add specific keywords to their comments and easily retrieve those keybindings later using the filter. For example:

Then, we can filter this by "vim-like".

Alternative behavior of the wanted feature

No response

Log File

No response

Sample Files

No response

guidocella commented 2 days ago

g-b has better input bindings search with fuzzy finding and keyboard navigation. I wasn't sure whether to put the comments there too.

VimWei commented 2 days ago

At the same time, I would like to be able to directly access a persistent Active Key Bindings page through a shortcut key. This would allow me ample time to further use features like filter to look up information.

Currently, I can only use the following definition in input.conf: ? script-binding stats/display-page-4

I wish there could be a definition similar to this: ? script-binding stats/display-page-4-toggle

The desired functionality is similar to how the uppercase 'I' key works in mpv, which toggles the persistent display of the stats page, as opposed to the lowercase 'i' key, which only shows the stats briefly.

VimWei commented 2 days ago

g-b has better input bindings search with fuzzy finding and keyboard navigation. I wasn't sure whether to put the comments there too.

Thanks! Though 'g-b' can solve some of the issues, its overall experience is not as user-friendly as Active Key Bindings.

guidocella commented 2 days ago

stats.lua doesn't have page up and down bindings because we don't know how many lines fill one page as mpv doesn't use a real GUI library. The linked PR implements every other request.

VimWei commented 1 day ago

Thank you!

I have tested the artifacts of the pull request, and it works perfectly.

It not only exceeded my initial expectations (by using up/down keys and maintaining consistency with the overall experience; it also added the ESC key for convenient exit), but the response speed is also incredibly fast.

Kudos to your excellent efforts!