Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mouse browsing support #22

Open
se7en-x230 opened this issue Jan 27, 2021 · 9 comments · May be fixed by #66
Open

Mouse browsing support #22

se7en-x230 opened this issue Jan 27, 2021 · 9 comments · May be fixed by #66
Labels
documentation Improvements or additions to documentation enhancement New feature or request question Further information is requested

Comments

@se7en-x230
Copy link

Can I scroll and select the files via mouse?

@CogentRedTester
Copy link
Owner

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.

@se7en-x230
Copy link
Author

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

@CogentRedTester
Copy link
Owner

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.

@se7en-x230
Copy link
Author

Excellent thanks

@CogentRedTester
Copy link
Owner

So I documented how to modify the default keybinds in commit 04f9fd2.

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 CogentRedTester added documentation Improvements or additions to documentation enhancement New feature or request question Further information is requested labels Jan 29, 2021
@se7en-x230
Copy link
Author

Amazing thank 👍

@CogentRedTester
Copy link
Owner

As of mpv-player/mpv#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
Copy link
Owner

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

CogentRedTester added a commit that referenced this issue Sep 16, 2022
Implements a new scrolling system for mouse-mode and properly calculates
the hovered item when scrolling the list.

This hover should work with custom font sizes, but currently the
calculations are not adding up for the header, so that is hardcoded.

See the next commit for keybinds.
@CogentRedTester CogentRedTester linked a pull request Sep 16, 2022 that will close this issue
6 tasks
@CogentRedTester
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants