manpage: improve "complex" key binding list of table entries

This commit is contained in:
wm4 2019-11-21 22:30:45 +01:00
parent 0a6c09b96f
commit a394d9e3ae
1 changed files with 13 additions and 6 deletions

View File

@ -251,12 +251,19 @@ The ``mp`` module is preloaded, although it can be loaded manually with
``complex``
If set to ``true``, then ``fn`` is called on both key up and down
events (as well as key repeat, if enabled), with the first
argument being a table. This table has an ``event`` entry, which
is set to one of the strings ``down``, ``repeat``, ``up`` or
``press`` (the latter if key up/down can't be tracked). The
``is_mouse`` entry tells whether the event was caused by a mouse
button. The ``key_name`` entry contains the name of they key that
triggered this, or ``nil`` if unknown or invoked artificially.
argument being a table. This table has the following entries (and
may contain undocumented ones):
``event``
Set to one of the strings ``down``, ``repeat``, ``up`` or
``press`` (the latter if key up/down can't be tracked).
``is_mouse``
Boolean Whether the event was caused by a mouse button.
``key_name``
The name of they key that triggered this, or ``nil`` if unknown
or invoked artificially.
Internally, key bindings are dispatched via the ``script-message-to`` or
``script-binding`` input commands and ``mp.register_script_message``.