aboutsummaryrefslogtreecommitdiff
path: root/docs/modules
diff options
context:
space:
mode:
authorThijs Schreijer <thijs@thijsschreijer.nl>2025-07-11 22:59:19 +0200
committerGitHub <noreply@github.com>2025-07-11 22:59:19 +0200
commit88ac69f94ddbe172458c79f2a5e37b6704c606a2 (patch)
tree09a61dfe8627cfed751fc9c7f597436970be86bf /docs/modules
parenta103ff16f13b9c7761d0fb2ec9db68da08193ebf (diff)
downloadluasystem-master.tar.gz
luasystem-master.tar.bz2
luasystem-master.zip
Release v0.6.3 (#75)HEADv0.6.3master
Diffstat (limited to 'docs/modules')
-rw-r--r--docs/modules/system.html15
1 files changed, 12 insertions, 3 deletions
diff --git a/docs/modules/system.html b/docs/modules/system.html
index 6840b85..0a2447e 100644
--- a/docs/modules/system.html
+++ b/docs/modules/system.html
@@ -1051,7 +1051,7 @@ sequences will be buffered internally and returned one byte at a time.
1051 the character that was received (can be multi-byte), or a complete ANSI sequence</li> 1051 the character that was received (can be multi-byte), or a complete ANSI sequence</li>
1052 <li> 1052 <li>
1053 <span class="types"><a class="type" href="https://www.lua.org/manual/5.4/manual.html#6.4">string</a></span> 1053 <span class="types"><a class="type" href="https://www.lua.org/manual/5.4/manual.html#6.4">string</a></span>
1054 the type of input: <code>&quot;char&quot;</code> for a single key, <code>&quot;ansi&quot;</code> for an ANSI sequence</li> 1054 the type of input: <code>&quot;ctrl&quot;</code> for 0-31 and 127 bytes, <code>&quot;char&quot;</code> for other UTF-8 characters, <code>&quot;ansi&quot;</code> for an ANSI sequence</li>
1055 </ol> 1055 </ol>
1056 <h3>Or</h3> 1056 <h3>Or</h3>
1057 <ol> 1057 <ol>
@@ -1070,6 +1070,15 @@ sequences will be buffered internally and returned one byte at a time.
1070 1070
1071 1071
1072 1072
1073 <h3>Usage:</h3>
1074 <ul>
1075 <pre class="example"><span class="keyword">local</span> key, keytype = system.<span class="function-name">readansi</span>(<span class="number">5</span>)
1076<span class="keyword">if</span> keytype == <span class="string">"char"</span> <span class="keyword">then</span> ... <span class="keyword">end</span> <span class="comment">-- printable character
1077</span><span class="keyword">if</span> keytype ~= <span class="string">"char"</span> <span class="keyword">then</span> ... <span class="keyword">end</span> <span class="comment">-- non-printable character or sequence
1078</span><span class="keyword">if</span> keytype == <span class="string">"ansi"</span> <span class="keyword">then</span> ... <span class="keyword">end</span> <span class="comment">-- a multi-byte sequence, but not a UTF8 character
1079</span><span class="keyword">if</span> keytype ~= <span class="string">"ansi"</span> <span class="keyword">then</span> ... <span class="keyword">end</span> <span class="comment">-- a valid UTF8 character (which includes control characters)
1080</span><span class="keyword">if</span> keytype == <span class="string">"ctrl"</span> <span class="keyword">then</span> ... <span class="keyword">end</span> <span class="comment">-- a single-byte ctrl character (0-31, 127)</span></pre>
1081 </ul>
1073 1082
1074</dd> 1083</dd>
1075 <dt> 1084 <dt>
@@ -1079,7 +1088,7 @@ sequences will be buffered internally and returned one byte at a time.
1079 <dd> 1088 <dd>
1080 Reads a single byte from the console, with a timeout. 1089 Reads a single byte from the console, with a timeout.
1081 This function uses <code>fsleep</code> to wait until either a byte is available or the timeout is reached. 1090 This function uses <code>fsleep</code> to wait until either a byte is available or the timeout is reached.
1082 The sleep period is exponentially backing off, starting at 0.0125 seconds, with a maximum of 0.2 seconds. 1091 The sleep period is exponentially backing off, starting at 0.0125 seconds, with a maximum of 0.1 seconds.
1083 It returns immediately if a byte is available or if <code>timeout</code> is less than or equal to <code>0</code>.</p> 1092 It returns immediately if a byte is available or if <code>timeout</code> is less than or equal to <code>0</code>.</p>
1084 1093
1085<p> Using <a href="../modules/system.html#readansi">system.readansi</a> is preferred over this function. Since this function can leave stray/invalid 1094<p> Using <a href="../modules/system.html#readansi">system.readansi</a> is preferred over this function. Since this function can leave stray/invalid
@@ -1509,7 +1518,7 @@ This function will sleep, without doing a busy-loop and wasting CPU cycles.
1509</div> <!-- id="main" --> 1518</div> <!-- id="main" -->
1510<div id="about"> 1519<div id="about">
1511<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i> 1520<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i>
1512<i style="float:right;">Last updated 2025-04-17 09:50:39 </i> 1521<i style="float:right;">Last updated 2025-07-11 22:55:05 </i>
1513</div> <!-- id="about" --> 1522</div> <!-- id="about" -->
1514</div> <!-- id="container" --> 1523</div> <!-- id="container" -->
1515</body> 1524</body>