From b08c8f50b5b1c29bd08aea8b586b6acfd680f3ce Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 19 Nov 2019 23:10:41 +0100 Subject: lua: report key name for "complex" key bindings This might make certain use cases less of a mess. --- DOCS/man/lua.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'DOCS/man') diff --git a/DOCS/man/lua.rst b/DOCS/man/lua.rst index d3034f1113..5f9525d6b6 100644 --- a/DOCS/man/lua.rst +++ b/DOCS/man/lua.rst @@ -253,9 +253,10 @@ The ``mp`` module is preloaded, although it can be loaded manually with 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). It further - has an ``is_mouse`` entry, which tells whether the event was caused - by a mouse button. + ``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. Internally, key bindings are dispatched via the ``script-message-to`` or ``script-binding`` input commands and ``mp.register_script_message``. -- cgit v1.2.3