summaryrefslogtreecommitdiffstats
path: root/DOCS/man
diff options
context:
space:
mode:
authorShuanglei Tao <tsl0922@gmail.com>2024-03-15 00:06:58 +0800
committerKacper Michajłow <kasper93@gmail.com>2024-04-06 08:24:06 +0200
commit3c1e98335127b28a7dc1b194e832b0e422f5ec9a (patch)
treed4fb1eb96416cfa9bae6f58cf3f15d6aaa6943ec /DOCS/man
parentf974382ca06655ac34debce7284ce87d01e5abd1 (diff)
downloadmpv-3c1e98335127b28a7dc1b194e832b0e422f5ec9a.tar.bz2
mpv-3c1e98335127b28a7dc1b194e832b0e422f5ec9a.tar.xz
vo: add win32 context menu support
Diffstat (limited to 'DOCS/man')
-rw-r--r--DOCS/man/input.rst45
-rw-r--r--DOCS/man/mpv.rst15
2 files changed, 60 insertions, 0 deletions
diff --git a/DOCS/man/input.rst b/DOCS/man/input.rst
index 341d20c926..ff68d7d146 100644
--- a/DOCS/man/input.rst
+++ b/DOCS/man/input.rst
@@ -927,6 +927,9 @@ Remember to quote string arguments in input.conf (see `Flat command syntax`_).
<keep-selection>
Do not change current track selections.
+``context-menu``
+ Show context menu on the video window. See `Context Menu`_ section for details.
+
Input Commands that are Possibly Subject to Change
--------------------------------------------------
@@ -3454,6 +3457,48 @@ Property list
and not using raw mode, the underlying content will be given (e.g. strings will be
printed directly, rather than quoted and JSON-escaped).
+``menu-data`` (RW)
+ This property stores the raw menu definition. See `Context Menu`_ section for details.
+
+ ``type``
+ Menu item type. Can be: ``separator``, ``submenu``, or empty.
+
+ ``title``
+ Menu item title. Required if type is not ``separator``.
+
+ ``cmd``
+ Command to execute when the menu item is clicked.
+
+ ``shortcut``
+ Menu item shortcut key which appears to the right of the menu item.
+ A shortcut key does not have to be functional; it's just a visual hint.
+
+ ``state``
+ Menu item state. Can be: ``checked``, ``disabled``, ``hidden``, or empty.
+
+ ``submenu``
+ Submenu items, which is required if type is ``submenu``.
+
+ When querying the property with the client API using ``MPV_FORMAT_NODE``, or with
+ Lua ``mp.get_property_native``, this will return a mpv_node with the following
+ contents:
+
+ ::
+
+ MPV_FORMAT_NODE_ARRAY
+ MPV_FORMAT_NODE_MAP (menu item)
+ "type" MPV_FORMAT_STRING
+ "title" MPV_FORMAT_STRING
+ "cmd" MPV_FORMAT_STRING
+ "shortcut" MPV_FORMAT_STRING
+ "state" MPV_FORMAT_NODE_ARRAY[MPV_FORMAT_STRING]
+ "submenu" MPV_FORMAT_NODE_ARRAY[menu item]
+
+ Writing to this property with the client API using ``MPV_FORMAT_NODE`` or with
+ Lua ``mp.set_property_native`` will trigger an immediate update of the menu if
+ mpv video output is currently active. You may observe the ``current-vo``
+ property to check if this is the case.
+
``working-directory``
The working directory of the mpv process. Can be useful for JSON IPC users,
because the command line player usually works with relative paths.
diff --git a/DOCS/man/mpv.rst b/DOCS/man/mpv.rst
index 93e9207061..d1711fcb22 100644
--- a/DOCS/man/mpv.rst
+++ b/DOCS/man/mpv.rst
@@ -310,6 +310,21 @@ Wheel left/right
Ctrl+Wheel up/down
Change video zoom.
+Context Menu
+-------------
+
+.. warning::
+
+ This feature is experimental. It may not work with all VOs. A libass based
+ fallback may be implemented in the future.
+
+Context Menu is a menu that pops up on the video window on user interaction
+(mouse right click, etc.).
+
+To use this feature, you need to fill the ``menu-data`` property with menu
+definition data, and add a keybinding to run the ``context-menu`` command,
+which can be done with a user script.
+
USAGE
=====