http://wiki.spheredev.org/index.php?title=Legacy:GetKey&feed=atom&action=history
Legacy:GetKey - Revision history
2024-03-29T15:10:25Z
Revision history for this page on the wiki
MediaWiki 1.29.0
http://wiki.spheredev.org/index.php?title=Legacy:GetKey&diff=429&oldid=prev
Radnen: /* Notes */
2013-05-20T22:16:36Z
<p><span dir="auto"><span class="autocomment">Notes</span></span></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;' lang='en'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 22:16, 20 May 2013</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l9" >Line 9:</td>
<td colspan="2" class="diff-lineno">Line 9:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>==Notes==</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>==Notes==</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Best used with [[API:AreKeysLeft|AreKeysLeft]() since this can block all execution until a key has been encountered.</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Best used with [[API:AreKeysLeft|AreKeysLeft<ins class="diffchange diffchange-inline">]</ins>]() since this can block all execution until a key has been encountered.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>==Examples==</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>==Examples==</div></td></tr>
</table>
Radnen
http://wiki.spheredev.org/index.php?title=Legacy:GetKey&diff=428&oldid=prev
Radnen: Created GetKey page
2013-05-20T22:16:15Z
<p>Created GetKey page</p>
<p><b>New page</b></p><div>[[Category:Functions]]<br />
<br />
Returns one instance of a KEY_* constant in the internal key queue.<br />
<br />
==Usage==<br />
<br />
{{Usage|returns=bool|func=GetKey}}<br />
<br />
==Notes==<br />
<br />
Best used with [[API:AreKeysLeft|AreKeysLeft]() since this can block all execution until a key has been encountered.<br />
<br />
==Examples==<br />
<br />
Blocking execution from continuing. It'll count each time you hit a random key.<br />
<br />
<syntaxhighlight><br />
<br />
var font = GetSystemFont();<br />
<br />
for (var i = 0; i < 10; ++i) {<br />
font.drawText(0, 0, i);<br />
FlipScreen();<br />
GetKey();<br />
}<br />
<br />
<br />
</syntaxhighlight><br />
<br />
It can also be used to clear the key buffer.<br />
<br />
<syntaxhighlight><br />
<br />
while (AreKeysLeft()) GetKey();<br />
<br />
</syntaxhighlight><br />
<br />
<br />
==See also==<br />
<br />
* [[API:AreKeysLeft|AreKeysLeft]]()<br />
* [[API:GetSystemFont|GetSystemFont]]()<br />
* [[API:FlipScreen|FlipScreen]]()<br />
* [[API:font/drawText|font.drawText]](x, y, text)</div>
Radnen