History

console.lua: add a keep_open flag to mp.input

With input.select this allows building nested submenus without the flicker of console quickly closing and reopening, and also doing multiple selections, to e.g. cycle through different values of a property, or increase a property multiple times. With input.get this is used to change the default behavior to closing by default on submit. It was argued by avih that this is more useful, and indeed Github code search shows that everybody is calling input.terminate() unconditionally on submit, so the impact of the change should be low, and restoring the old behavior is as easy as passing keep_open = true, which is just ignored in older mpv versions.

Guido Cella committed 1 year ago

Commit 996c0981 parent 7dd51544 files · +17 −9Browse files

Showing the changes to DOCS/interface-changes (1 of 4 files). Show all

Unified · Split

DOCS/interface-changes/mp.input.txt+2−0
@@ -0,0 +1,2 @@
1add `keep_open` flag to `mp.input.get()` and `mp.input.select()`
2`mp.input.get()` now closes automatically on submit, pass `keep_open = true` to restore the old behavior

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t