mpv-file-browser
mpv-file-browser copied to clipboard
Mouse browsing support
Can I scroll and select the files via mouse?
Scrolling with the scroll wheels and opening the currently selected item with left click is pretty simple, and can already be done with the custom key bindings.
However, selecting items by mouse position is much harder, it would require calculating the pixel height of each line and mapping that to each entry. It may also interfere with the OSC. For those reasons I don't plan to implement point and click support.
Thanks for the fast reply. Could you point me in the right direction how to implement the scroll and left click actions?
All the dynamic keybinds are given a name which can be called via the script-binding command. I don't have time to explain the naming format right now, but I'll add a guide to the readme in the next couple of days.
Excellent thanks
So I documented how to modify the default keybinds in commit 04f9fd25719a4847fedc22063544b497dd70c93f.
For reference a default set of bindings you may find useful are:
[
{
"key": "WHEEL_UP",
"command": ["script-binding", "file_browser/dynamic/scroll_up"]
},
{
"key": "WHEEL_DOWN",
"command": ["script-binding", "file_browser/dynamic/scroll_down"]
},
{
"key": "MBTN_LEFT",
"command": ["script-binding", "file_browser/dynamic/down_dir"]
},
{
"key": "MBTN_RIGHT",
"command": ["script-binding", "file_browser/dynamic/up_dir"]
},
{
"key": "MBTN_MID",
"command": ["script-binding", "file_browser/dynamic/play"]
},
{
"key": "Shift+MBTN_MID",
"command": ["script-binding", "file_browser/dynamic/play_append"]
},
{
"key": "Alt+MBTN_MID",
"command": ["script-binding", "file_browser/dynamic/play_autoload"]
}
]
Amazing thank :+1:
As of https://github.com/mpv-player/mpv/pull/8261 added in v0.33 it has now become viable to implement actual mouse support. I plan to explore doing so at some point in the future, though I am not making any guarantees.
I am going to keep this issue open to track any future progress.
Any work on this will be done in the mouse-support branch.
For anyone who may be subscribed or looking at this issue I have opened a PR (#66 ) that implements full point & click mouse support. Any feedback on default bindings is welcome.