@@ -4865,7 +4865,10 @@ <h2>Input</h2>
4865
4865
<dd>Specify input configuration file other than the default location in the mpv
4866
4866
configuration directory (usually <tt class="docutils literal"><span class="pre">~/.config/mpv/input.conf</span></tt>).</dd>
4867
4867
<dt><tt class="docutils literal"><span class="pre">--no-input-default-bindings</span></tt></dt>
4868
- <dd>Disable mpv default (built-in) key bindings.</dd>
4868
+ <dd>Disable mpv default (built-in) key bindings. Currently this includes all
4869
+ key bindings which <tt class="docutils literal">input.conf</tt> can override, like those added by scripts
4870
+ using <tt class="docutils literal">mp.add_key_binding</tt> (but not <tt class="docutils literal">mp.add_forced_key_binding</tt>).
4871
+ This might change in the future to exclude <tt class="docutils literal">mp.add_key_binding</tt>.</dd>
4869
4872
<dt><tt class="docutils literal"><span class="pre">--input-cmdlist</span></tt></dt>
4870
4873
<dd>Prints all commands that can be bound to keys.</dd>
4871
4874
<dt><tt class="docutils literal"><span class="pre">--input-doubleclick-time=<milliseconds></span></tt></dt>
@@ -10757,7 +10760,8 @@ <h2>Input Commands that are Possibly Subject to Change</h2>
10757
10760
<dt><tt class="docutils literal"><span class="pre">script-message-to</span> <target> [<arg1> [<arg2> <span class="pre">[...]]]</span></tt></dt>
10758
10761
<dd><p class="first">Same as <tt class="docutils literal"><span class="pre">script-message</span></tt>, but send it only to the client named
10759
10762
<tt class="docutils literal"><target></tt>. Each client (scripts etc.) has a unique name. For example,
10760
- Lua scripts can get their name via <tt class="docutils literal">mp.get_script_name()</tt>.</p>
10763
+ Lua scripts can get their name via <tt class="docutils literal">mp.get_script_name()</tt>. Note that
10764
+ client names only consist of alphanumeric characters and <tt class="docutils literal">_</tt>.</p>
10761
10765
<p class="last">This command has a variable number of arguments, and cannot be used with
10762
10766
named arguments.</p>
10763
10767
</dd>
@@ -10766,7 +10770,8 @@ <h2>Input Commands that are Possibly Subject to Change</h2>
10766
10770
bindings provided by external Lua scripts.</p>
10767
10771
<p>The argument is the name of the binding.</p>
10768
10772
<p>It can optionally be prefixed with the name of the script, using <tt class="docutils literal">/</tt> as
10769
- separator, e.g. <tt class="docutils literal"><span class="pre">script-binding</span> scriptname/bindingname</tt>.</p>
10773
+ separator, e.g. <tt class="docutils literal"><span class="pre">script-binding</span> scriptname/bindingname</tt>. Note that script
10774
+ names only consist of alphanumeric characters and <tt class="docutils literal">_</tt>.</p>
10770
10775
<p>For completeness, here is how this command works internally. The details
10771
10776
could change any time. On any matching key event, <tt class="docutils literal"><span class="pre">script-message-to</span></tt>
10772
10777
or <tt class="docutils literal"><span class="pre">script-message</span></tt> is called (depending on whether the script name is
@@ -11335,6 +11340,8 @@ <h2>Property list</h2>
11335
11340
quantities: fps and possibly rounded timestamps.)</p>
11336
11341
</div>
11337
11342
</dd>
11343
+ <dt><tt class="docutils literal">pid</tt></dt>
11344
+ <dd>Process-id of mpv.</dd>
11338
11345
<dt><tt class="docutils literal">path</tt></dt>
11339
11346
<dd>Full path of the currently played file. Usually this is exactly the same
11340
11347
string you pass on the mpv command line or the <tt class="docutils literal">loadfile</tt> command, even
@@ -11917,6 +11924,10 @@ <h2>Property list</h2>
11917
11924
<tt class="docutils literal"><span class="pre">--video-sync</span></tt>) is active.</dd>
11918
11925
<dt><tt class="docutils literal"><span class="pre">vsync-jitter</span></tt></dt>
11919
11926
<dd>Estimated deviation factor of the vsync duration.</dd>
11927
+ <dt><tt class="docutils literal"><span class="pre">display-width</span></tt>, <tt class="docutils literal"><span class="pre">display-height</span></tt></dt>
11928
+ <dd>The current display's horizontal and vertical resolution in pixels. Whether
11929
+ or not these values update as the mpv window changes displays depends on
11930
+ the windowing backend. It may not be available on all platforms.</dd>
11920
11931
<dt><tt class="docutils literal"><span class="pre">display-hidpi-scale</span></tt></dt>
11921
11932
<dd>The HiDPI scale factor as reported by the windowing backend. If no VO is
11922
11933
active, or if the VO does not report a value, this property is unavailable.
@@ -11930,8 +11941,8 @@ <h2>Property list</h2>
11930
11941
</dd>
11931
11942
<dt><tt class="docutils literal"><span class="pre">osd-width</span></tt>, <tt class="docutils literal"><span class="pre">osd-height</span></tt></dt>
11932
11943
<dd><p class="first">Last known OSD width (can be 0). This is needed if you want to use the
11933
- <tt class="docutils literal"><span class="pre">overlay-add</span></tt> command. It gives you the actual OSD size, which can be
11934
- different from the window size in some cases .</p>
11944
+ <tt class="docutils literal"><span class="pre">overlay-add</span></tt> command. It gives you the actual OSD/window size (not
11945
+ including decorations drawn by the OS window manager) .</p>
11935
11946
<p class="last">Alias to <tt class="docutils literal"><span class="pre">osd-dimensions/w</span></tt> and <tt class="docutils literal"><span class="pre">osd-dimensions/h</span></tt>.</p>
11936
11947
</dd>
11937
11948
<dt><tt class="docutils literal"><span class="pre">osd-par</span></tt></dt>
@@ -13574,6 +13585,11 @@ <h2>Script location</h2>
13574
13585
scripting backend to use for it. For Lua, it is <tt class="docutils literal">.lua</tt>. If the extension is
13575
13586
not recognized, an error is printed. (If an error happens, the extension is
13576
13587
either mistyped, or the backend was not compiled into your mpv binary.)</p>
13588
+ <p>mpv internally loads the script's name by stripping the <tt class="docutils literal">.lua</tt> extension and
13589
+ replacing all nonalphanumeric characters with <tt class="docutils literal">_</tt>. E.g., <tt class="docutils literal"><span class="pre">my-tools.lua</span></tt>
13590
+ becomes <tt class="docutils literal">my_tools</tt>. If there are several scripts with the same name, it is
13591
+ made unique by appending a number. This is the name returned by
13592
+ <tt class="docutils literal">mp.get_script_name()</tt>.</p>
13577
13593
<p>Entries with <tt class="docutils literal">.disable</tt> extension are always ignored.</p>
13578
13594
<p>If a script is a directory (either if a directory is passed to <tt class="docutils literal"><span class="pre">--script</span></tt>,
13579
13595
or any sub-directories in the script directory, such as for example
@@ -13976,10 +13992,10 @@ <h2>mp functions</h2>
13976
13992
<dd><p class="first">Return the name of the current script. The name is usually made of the
13977
13993
filename of the script, with directory and file extension removed. If
13978
13994
there are several scripts which would have the same name, it's made unique
13979
- by appending a number.</p>
13995
+ by appending a number. Any nonalphanumeric characters are replaced with <tt class="docutils literal">_</tt>. </p>
13980
13996
<div class="admonition admonition-example last">
13981
13997
<p class="first admonition-title">Example</p>
13982
- <p class="last">The script <tt class="docutils literal">/path/to/fooscript .lua</tt> becomes <tt class="docutils literal">fooscript </tt>.</p>
13998
+ <p class="last">The script <tt class="docutils literal"><span class="pre"> /path/to/foo-script .lua</span></ tt> becomes <tt class="docutils literal">foo_script </tt>.</p>
13983
13999
</div>
13984
14000
</dd>
13985
14001
<dt><tt class="docutils literal">mp.get_script_directory()</tt></dt>
@@ -14211,7 +14227,7 @@ <h2>mp.utils functions</h2>
14211
14227
<dt><tt class="docutils literal">mtime</tt></dt>
14212
14228
<dd>time of last modification</dd>
14213
14229
<dt><tt class="docutils literal">ctime</tt></dt>
14214
- <dd>time of last metadata change (Linux) / time of creation (Windows) </dd>
14230
+ <dd>time of last metadata change</dd>
14215
14231
<dt><tt class="docutils literal">is_file</tt></dt>
14216
14232
<dd>Whether <tt class="docutils literal">path</tt> is a regular file (boolean)</dd>
14217
14233
<dt><tt class="docutils literal">is_dir</tt></dt>
0 commit comments