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

console.lua: allow clicking selectable items #15016

Merged
merged 1 commit into from
Oct 8, 2024

Conversation

guidocella
Copy link
Contributor

This adds click support for the select menu. Scrolling with the wheel already worked.

If a custom OSC binds a button to a select.lua script-binding, this lets users keep using the mouse to select an item.

While the OSC and the select menu are open at the same time, you can no longer click the OSC's buttons. By using mp.add_key_binding instead of add_forced_key_binding you could click both, but the console's binding would be shadowed by MBTN_LEFT bindings in input.conf.

Inspired by https://github.com/Samillion/ModernZ

@Samillion
Copy link
Contributor

This is a game changer, much appreciated.

@bt4ibwem8 was talking to me about this very thing.

Personal side of things, absolutely loving that select.lua is now part of mpv.

@guidocella guidocella force-pushed the console-mouse branch 2 times, most recently from 8215cee to b9114b7 Compare October 7, 2024 20:56
Copy link

github-actions bot commented Oct 7, 2024

Download the artifacts for this pull request:

Windows
macOS

@kasper93
Copy link
Contributor

kasper93 commented Oct 7, 2024

I think it would be good to keep highlighted item follow mouse pointer.

@kasper93
Copy link
Contributor

kasper93 commented Oct 8, 2024

Should left mouse click select currently highlighted element instead of mouse position?

@guidocella
Copy link
Contributor Author

I updated the highlight before clicking. Chrome and Firefox separately highlight the lines with keyboard and pointer focus but it might be overkill here.

This adds click support for the select menu. Scrolling with the wheel
already worked.

If a custom OSC binds a button to a select.lua script-binding, this lets
users keep using the mouse to select an item.

While the OSC and the select menu are open at the same time, you can no
longer click the OSC's buttons. By using mp.add_key_binding instead of
add_forced_key_binding you could click both, but the console's binding
would be shadowed by MBTN_LEFT bindings in input.conf.
@kasper93 kasper93 merged commit 8bf5548 into mpv-player:master Oct 8, 2024
25 checks passed
@guidocella guidocella deleted the console-mouse branch October 8, 2024 18:38
Samillion added a commit to Samillion/ModernZ that referenced this pull request Oct 9, 2024
After a discussion at mpv that started with this:
mpv-player/mpv#15016

It has lead to a complete removal of redundant functions that mpv is already capable of doing from the osc.

References:
mpv-player/mpv#15031
mpv-player/mpv#15038

Also, increased title max character limit to fix #9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants