<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://wiki.spheredev.org/index.php?action=history&amp;feed=atom&amp;title=Legacy%3AIsKeyPressed</id>
		<title>Legacy:IsKeyPressed - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.spheredev.org/index.php?action=history&amp;feed=atom&amp;title=Legacy%3AIsKeyPressed"/>
		<link rel="alternate" type="text/html" href="http://wiki.spheredev.org/index.php?title=Legacy:IsKeyPressed&amp;action=history"/>
		<updated>2026-05-13T20:39:49Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.29.0</generator>

	<entry>
		<id>http://wiki.spheredev.org/index.php?title=Legacy:IsKeyPressed&amp;diff=569&amp;oldid=prev</id>
		<title>Apollolux: /* Notes */ see also</title>
		<link rel="alternate" type="text/html" href="http://wiki.spheredev.org/index.php?title=Legacy:IsKeyPressed&amp;diff=569&amp;oldid=prev"/>
				<updated>2013-06-01T22:01:04Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Notes: &lt;/span&gt; see also&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 22:01, 1 June 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l33&quot; &gt;Line 33:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 33:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;div&gt;*	If you need to find out if any key is being pressed, it's better to use the [[API:IsAnyKeyPressed|IsAnyKeyPressed]]() function.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;div&gt;*	If you need to find out if any key is being pressed, it's better to use the [[API:IsAnyKeyPressed|IsAnyKeyPressed]]() function.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;div&gt;See also&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;==&lt;/ins&gt;See also&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;div&gt;* [[List of keycode constants]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;div&gt;* [[List of keycode constants]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Apollolux</name></author>	</entry>

	<entry>
		<id>http://wiki.spheredev.org/index.php?title=Legacy:IsKeyPressed&amp;diff=568&amp;oldid=prev</id>
		<title>Apollolux: created from http://web.archive.org/web/20111228001515/http://www.spheredev.org/wiki/IsKeyPressed</title>
		<link rel="alternate" type="text/html" href="http://wiki.spheredev.org/index.php?title=Legacy:IsKeyPressed&amp;diff=568&amp;oldid=prev"/>
				<updated>2013-06-01T21:58:16Z</updated>
		
		<summary type="html">&lt;p&gt;created from http://web.archive.org/web/20111228001515/http://www.spheredev.org/wiki/IsKeyPressed&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Check if a certain key is being held down on the keyboard.&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
&lt;br /&gt;
{{Usage|returns=boolean|func=IsKeyPressed|params=key}}&lt;br /&gt;
&lt;br /&gt;
* '''key''' String. The key code that should be checked. See the [[list of keycode constants]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
if (IsKeyPressed(KEY_ENTER))&lt;br /&gt;
{&lt;br /&gt;
  //Code&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
IsKeyPressed() is often used in conditions and loops. The above will check if the Enter key was pressed, and if so, it will run the condition.&lt;br /&gt;
&lt;br /&gt;
You can use !&amp;lt;code&amp;gt;IsKeyPressed&amp;lt;/code&amp;gt; to negate the function: if the key was NOT pressed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
if (!IsKeyPressed(KEY_ENTER))&lt;br /&gt;
{&lt;br /&gt;
  // ...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
&lt;br /&gt;
*	This function does not halt the engine like [[API:GetKey|GetKey]]() does, and can therefore be used in continuous loops.&lt;br /&gt;
*	Do not use this function to check for key strokes. This function doesn't use a key queue, so it's suited for controlling a spaceship or a person on a map. However, if you need to pick up every key stroke (e.g. for a text box), use [[API:GetKey|GetKey]]() instead.&lt;br /&gt;
*	If you need to find out if any key is being pressed, it's better to use the [[API:IsAnyKeyPressed|IsAnyKeyPressed]]() function.&lt;br /&gt;
&lt;br /&gt;
See also&lt;br /&gt;
&lt;br /&gt;
* [[List of keycode constants]]&lt;br /&gt;
* [[API:IsAnyKeyPressed|IsAnyKeyPressed]]()&lt;br /&gt;
* [[API:AreKeysLeft|AreKeysLeft]]()&lt;br /&gt;
* [[API:GetKey|GetKey]]()&lt;/div&gt;</summary>
		<author><name>Apollolux</name></author>	</entry>

	</feed>