summaryrefslogtreecommitdiffstats
path: root/DOCS/man/javascript.rst
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:13:15 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:13:15 +0000
commitbff6c10f6909412899de6ab7c902f96080905550 (patch)
tree616d06233c652837e0d36657306ed0c157821a9a /DOCS/man/javascript.rst
parentReleasing progress-linux version 0.37.0-1~progress7.99u1. (diff)
downloadmpv-bff6c10f6909412899de6ab7c902f96080905550.tar.xz
mpv-bff6c10f6909412899de6ab7c902f96080905550.zip
Merging upstream version 0.38.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--DOCS/man/javascript.rst23
1 files changed, 17 insertions, 6 deletions
diff --git a/DOCS/man/javascript.rst b/DOCS/man/javascript.rst
index bdbb04b..0edb01f 100644
--- a/DOCS/man/javascript.rst
+++ b/DOCS/man/javascript.rst
@@ -27,16 +27,17 @@ otherwise, the documented Lua options, script directories, loading, etc apply to
JavaScript files too.
Script initialization and lifecycle is the same as with Lua, and most of the Lua
-functions at the modules ``mp``, ``mp.utils``, ``mp.msg`` and ``mp.options`` are
-available to JavaScript with identical APIs - including running commands,
-getting/setting properties, registering events/key-bindings/hooks, etc.
+functions in the modules ``mp``, ``mp.utils``, ``mp.msg``, ``mp.options`` and
+``mp.input`` are available to JavaScript with identical APIs - including running
+commands, getting/setting properties, registering events/key-bindings/hooks,
+etc.
Differences from Lua
--------------------
-No need to load modules. ``mp``, ``mp.utils``, ``mp.msg`` and ``mp.options``
-are preloaded, and you can use e.g. ``var cwd = mp.utils.getcwd();`` without
-prior setup.
+No need to load modules. ``mp``, ``mp.utils``, ``mp.msg``, ``mp.options`` and
+``mp.input`` are preloaded, and you can use e.g. ``var cwd =
+mp.utils.getcwd();`` without prior setup.
Errors are slightly different. Where the Lua APIs return ``nil`` for error,
the JavaScript ones return ``undefined``. Where Lua returns ``something, error``
@@ -195,6 +196,16 @@ meta-paths like ``~~/foo`` (other JS file functions do expand meta paths).
``mp.options.read_options(obj [, identifier [, on_update]])`` (types:
string/boolean/number)
+``mp.input.get(obj)`` (LE)
+
+``mp.input.terminate()``
+
+``mp.input.log(message, style)``
+
+``mp.input.log_error(message)``
+
+``mp.input.set_log(log)``
+
Additional utilities
--------------------