diff --git a/DOCS/man/lua.rst b/DOCS/man/lua.rst index 4fc8de04f6d65..712ac9fbda6d0 100644 --- a/DOCS/man/lua.rst +++ b/DOCS/man/lua.rst @@ -284,7 +284,7 @@ The ``mp`` module is preloaded, although it can be loaded manually with Return the current mpv internal time in seconds as a number. This is basically the system time, with an arbitrary offset. -``mp.add_key_binding(key, name|fn [,fn [,flags]])`` +``mp.add_key_binding(key, name|fn [,fn [,flags, [arg]]])`` Register callback to be run on a key binding. The binding will be mapped to the given ``key``, which is a string describing the physical key. This uses the same key names as in input.conf, and also allows combinations @@ -316,7 +316,7 @@ The ``mp`` module is preloaded, although it can be loaded manually with or pass the ``fn`` argument in place of the name. The latter is not recommended and is handled for compatibility only.) - The last argument is used for optional flags. This is a table, which can + The last argument is used for optional parameters. This is a table, which can have the following entries: ``repeatable`` @@ -327,6 +327,11 @@ The ``mp`` module is preloaded, although it can be loaded manually with If set to ``true``, enables key scaling for this specific binding. This option only makes sense when ``complex`` is set to ``true``. + ``arg`` + A user-provided string which is available in the table argument of + ``fn`` by default. + This option only makes sense when ``complex`` is set to ``true``. + ``complex`` If set to ``true``, then ``fn`` is called on key down, repeat and up events, with the first argument being a table. This table has the @@ -358,6 +363,11 @@ The ``mp`` module is preloaded, although it can be loaded manually with The scale of the key, such as the ones produced by ``WHEEL_*`` keys. The scale is 1 if the key is nonscalable. + ``arg`` + User-provided string in the ``arg`` argument, or the ``arg`` + in the ``script-binding`` command if the key binding is invoked + by that command. + Internally, key bindings are dispatched via the ``script-message-to`` or ``script-binding`` input commands and ``mp.register_script_message``.