<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Maratis forum - KeyPress!]]></title>
		<link>http://forum.maratis3d.com/viewtopic.php?id=165</link>
		<description><![CDATA[The most recent posts in KeyPress!.]]></description>
		<lastBuildDate>Mon, 19 Sep 2011 16:03:25 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: KeyPress!]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=645#p645</link>
			<description><![CDATA[<p>I don&#039;t have vc 2005. I will wait until next release.</p><p>Regards.</p>]]></description>
			<author><![CDATA[dummy@example.com (Arclord)]]></author>
			<pubDate>Mon, 19 Sep 2011 16:03:25 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=645#p645</guid>
		</item>
		<item>
			<title><![CDATA[Re: KeyPress!]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=644#p644</link>
			<description><![CDATA[<p>&quot;onKeyDown&quot; is not affected, except for the same keys that was not recognized on windows &quot;LSHIFT etc&quot;.</p><p>Your problem with &quot;onKeyDown&quot; is probably just linked with the use of &quot;flush&quot; yes. You need to flush the keys only after doing all your code logic, best is to put your code just after or before the script call :</p><p>If you want to call it before the script, you are not forced to redo all the update game function :</p><div class="codebox"><pre><code>void MyGame::update(void)
{
        // put your code here

        MGame::update(void);
}</code></pre></div><p>But if you want to call it after the script, you need to redo all the update function :</p><div class="codebox"><pre><code>void MyGame::update(void)
{
        MEngine * engine = MEngine::getInstance();

        // run script
        if(engine-&gt;getScriptContext())
                engine-&gt;getScriptContext()-&gt;callFunction(&quot;onSceneUpdate&quot;);


        // put your code here


        // get level
        MLevel * level = MEngine::getInstance()-&gt;getLevel();
        if(! level)
                return;

        // get current scene
        MScene * scene = level-&gt;getCurrentScene();
        if(! scene)
                return;

        // update behaviors
        unsigned int i;
        unsigned int oSize = scene-&gt;getObjectsNumber();
        for(i=0; i&lt;oSize; i++)
        {
                MObject3d * object = scene-&gt;getObjectByIndex(i);
                if(! object-&gt;isActive())
                        continue;
                        
                object-&gt;updateBehaviors();
        }

        // update scene
        scene-&gt;update();

        // update physics
        scene-&gt;updatePhysics();

        // update objects matrices
        scene-&gt;updateObjectsMatrices();

        // flush input
        engine-&gt;getInputContext()-&gt;flush();
}</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (anael)]]></author>
			<pubDate>Mon, 19 Sep 2011 12:11:56 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=644#p644</guid>
		</item>
		<item>
			<title><![CDATA[Re: KeyPress!]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=643#p643</link>
			<description><![CDATA[<p>Is it also a bug with &quot;onKeyDown()&quot; (with the maratis engine) ?</p><div class="quotebox"><cite>Alinor wrote:</cite><blockquote><p>I have some problems with the function &quot;bool onKeydown(* char)&quot; with keyboard symbols : the effect in maratis is quite similar to &quot;bool isKeyPressed(* char)&quot;, I think that I should maybe use &quot;void flush(void)&quot; but I don&#039;t know how do it ...</p></blockquote></div>]]></description>
			<author><![CDATA[dummy@example.com (Alinor)]]></author>
			<pubDate>Mon, 19 Sep 2011 11:31:02 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=643#p643</guid>
		</item>
		<item>
			<title><![CDATA[Re: KeyPress!]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=642#p642</link>
			<description><![CDATA[<p>it&#039;s corrected, there was a bug on windows keys,<br />the new code is available on SVN trunk, if you have visual studio you can build it<br />(just open trunk/dev/Projects/VisualStudio2005/Maratis.sln and run the build in &quot;release&quot;).</p>]]></description>
			<author><![CDATA[dummy@example.com (anael)]]></author>
			<pubDate>Mon, 19 Sep 2011 09:37:32 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=642#p642</guid>
		</item>
		<item>
			<title><![CDATA[Re: KeyPress!]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=638#p638</link>
			<description><![CDATA[<p>OK, I am using XP.</p><p>Regards.</p>]]></description>
			<author><![CDATA[dummy@example.com (Arclord)]]></author>
			<pubDate>Sat, 17 Sep 2011 18:29:43 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=638#p638</guid>
		</item>
		<item>
			<title><![CDATA[Re: KeyPress!]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=637#p637</link>
			<description><![CDATA[<p>Strange, it&#039;s working for me, at least on mac,<br />I&#039;ll try later on windows.</p>]]></description>
			<author><![CDATA[dummy@example.com (anael)]]></author>
			<pubDate>Sat, 17 Sep 2011 17:16:38 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=637#p637</guid>
		</item>
		<item>
			<title><![CDATA[KeyPress!]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=636#p636</link>
			<description><![CDATA[<p>Hi,<br />&nbsp; &nbsp;</p><div class="codebox"><pre><code>if isKeyPressed(&quot;LSHIFT&quot;) then
          do something
end</code></pre></div><p>&nbsp; &nbsp;This is not working. It seems that it does not work with shift, control also. Is there any other way for these keys presses!</p><p>Regards</p>]]></description>
			<author><![CDATA[dummy@example.com (Arclord)]]></author>
			<pubDate>Sat, 17 Sep 2011 05:50:45 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=636#p636</guid>
		</item>
	</channel>
</rss>
