mpv-file-browser icon indicating copy to clipboard operation
mpv-file-browser copied to clipboard

Mouse browsing support

Open se7en-x230 opened this issue 4 years ago • 9 comments
trafficstars

Can I scroll and select the files via mouse?

se7en-x230 avatar Jan 27 '21 03:01 se7en-x230

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.

CogentRedTester avatar Jan 27 '21 04:01 CogentRedTester

Thanks for the fast reply. Could you point me in the right direction how to implement the scroll and left click actions?

se7en-x230 avatar Jan 27 '21 04:01 se7en-x230

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.

CogentRedTester avatar Jan 27 '21 04:01 CogentRedTester

Excellent thanks

se7en-x230 avatar Jan 27 '21 05:01 se7en-x230

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"]
    }
]

CogentRedTester avatar Jan 29 '21 01:01 CogentRedTester

Amazing thank :+1:

se7en-x230 avatar Jan 29 '21 03:01 se7en-x230

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.

CogentRedTester avatar Mar 17 '21 12:03 CogentRedTester

Any work on this will be done in the mouse-support branch.

CogentRedTester avatar May 08 '21 11:05 CogentRedTester

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.

CogentRedTester avatar Sep 16 '22 13:09 CogentRedTester