<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Maratis forum - KeyPress!]]></title>
	<link rel="self" href="http://forum.maratis3d.com/extern.php?action=feed&amp;tid=165&amp;type=atom"/>
	<updated>2011-09-19T16:03:25Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.maratis3d.com/viewtopic.php?id=165</id>
		<entry>
			<title type="html"><![CDATA[Re: KeyPress!]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=645#p645"/>
			<content type="html"><![CDATA[<p>I don&#039;t have vc 2005. I will wait until next release.</p><p>Regards.</p>]]></content>
			<author>
				<name><![CDATA[Arclord]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=211</uri>
			</author>
			<updated>2011-09-19T16:03:25Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=645#p645</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: KeyPress!]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=644#p644"/>
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[anael]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2</uri>
			</author>
			<updated>2011-09-19T12:11:56Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=644#p644</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: KeyPress!]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=643#p643"/>
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Alinor]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=64</uri>
			</author>
			<updated>2011-09-19T11:31:02Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=643#p643</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: KeyPress!]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=642#p642"/>
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[anael]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2</uri>
			</author>
			<updated>2011-09-19T09:37:32Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=642#p642</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: KeyPress!]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=638#p638"/>
			<content type="html"><![CDATA[<p>OK, I am using XP.</p><p>Regards.</p>]]></content>
			<author>
				<name><![CDATA[Arclord]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=211</uri>
			</author>
			<updated>2011-09-17T18:29:43Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=638#p638</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: KeyPress!]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=637#p637"/>
			<content type="html"><![CDATA[<p>Strange, it&#039;s working for me, at least on mac,<br />I&#039;ll try later on windows.</p>]]></content>
			<author>
				<name><![CDATA[anael]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2</uri>
			</author>
			<updated>2011-09-17T17:16:38Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=637#p637</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[KeyPress!]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=636#p636"/>
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Arclord]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=211</uri>
			</author>
			<updated>2011-09-17T05:50:45Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=636#p636</id>
		</entry>
</feed>
