summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido Cella <guido@guidocella.xyz>2021-07-21 08:13:23 +0200
committerAvi Halachmi (:avih) <avihpit@yahoo.com>2021-07-21 13:55:58 +0300
commitccb87ad6374c69beb7e88357003bb13cb427a6ee (patch)
treed49f7fc8f2d153668d31f5397fe5dc7dafed7d9e
parent23e3b0ad980c1d94973453cb9b48a2d3a3f48e0d (diff)
downloadmpv-ccb87ad6374c69beb7e88357003bb13cb427a6ee.tar.bz2
mpv-ccb87ad6374c69beb7e88357003bb13cb427a6ee.tar.xz
stats.lua: remove script-opts for the main keys (i/I)
Unlike the page switching/scrolling keys which are bound at runtime and therefore we need to know which (configured) keys to bind, the main keys (i/I by default) are static and can be bound via input.conf. And indeed, the builtin bindings at etc/input.conf have them already.
-rw-r--r--DOCS/man/stats.rst13
-rw-r--r--player/lua/stats.lua6
2 files changed, 4 insertions, 15 deletions
diff --git a/DOCS/man/stats.rst b/DOCS/man/stats.rst
index 9e6b7bc453..58d73b4072 100644
--- a/DOCS/man/stats.rst
+++ b/DOCS/man/stats.rst
@@ -52,13 +52,6 @@ option. The configuration syntax is described in `ON SCREEN CONTROLLER`_.
Configurable Options
~~~~~~~~~~~~~~~~~~~~
-``key_oneshot``
- Default: i
-``key_toggle``
- Default: I
-
- Key bindings to display stats.
-
``key_page_1``
Default: 1
``key_page_2``
@@ -174,14 +167,12 @@ Note: colors are given as hexadecimal values and use ASS tag order: BBGGRR
Different key bindings
~~~~~~~~~~~~~~~~~~~~~~
-A different key binding can be defined with the aforementioned options
-``key_oneshot`` and ``key_toggle`` but also with commands in ``input.conf``,
-for example::
+Additional keys can be configured in ``input.conf`` to display the stats::
e script-binding stats/display-stats
E script-binding stats/display-stats-toggle
-Using ``input.conf``, it is also possible to directly display a certain page::
+And to display a certain page directly::
i script-binding stats/display-page-1
e script-binding stats/display-page-2
diff --git a/player/lua/stats.lua b/player/lua/stats.lua
index a5871822b7..a764ebdbdf 100644
--- a/player/lua/stats.lua
+++ b/player/lua/stats.lua
@@ -13,8 +13,6 @@ local utils = require 'mp.utils'
-- Options
local o = {
-- Default key bindings
- key_oneshot = "i",
- key_toggle = "I",
key_page_1 = "1",
key_page_2 = "2",
key_page_3 = "3",
@@ -1125,11 +1123,11 @@ display_timer = mp.add_periodic_timer(o.duration,
display_timer:kill()
-- Single invocation key binding
-mp.add_key_binding(o.key_oneshot, "display-stats", function() process_key_binding(true) end,
+mp.add_key_binding(nil, "display-stats", function() process_key_binding(true) end,
{repeatable=true})
-- Toggling key binding
-mp.add_key_binding(o.key_toggle, "display-stats-toggle", function() process_key_binding(false) end,
+mp.add_key_binding(nil, "display-stats-toggle", function() process_key_binding(false) end,
{repeatable=false})
-- Single invocation bindings without key, can be used in input.conf to create