console.lua: allow clicking selectable items #15016
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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