<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[GMan's Mods & Stuff — SmoothEventReciever - error when key pressed]]></title>
	<link rel="self" href="https://gprogs.com/extern.php?action=feed&amp;tid=390&amp;type=atom" />
	<updated>2010-08-12T23:54:07Z</updated>
	<generator>PunBB</generator>
	<id>https://gprogs.com/viewtopic.php?id=390</id>
		<entry>
			<title type="html"><![CDATA[Re: SmoothEventReciever - error when key pressed]]></title>
			<link rel="alternate" href="https://gprogs.com/viewtopic.php?pid=1631#p1631" />
			<content type="html"><![CDATA[<p>there is a new version of the addons for download.</p>]]></content>
			<author>
				<name><![CDATA[gman]]></name>
				<uri>https://gprogs.com/profile.php?id=2</uri>
			</author>
			<updated>2010-08-12T23:54:07Z</updated>
			<id>https://gprogs.com/viewtopic.php?pid=1631#p1631</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: SmoothEventReciever - error when key pressed]]></title>
			<link rel="alternate" href="https://gprogs.com/viewtopic.php?pid=1627#p1627" />
			<content type="html"><![CDATA[]]></content>
			<author>
				<name><![CDATA[gman]]></name>
				<uri>https://gprogs.com/profile.php?id=2</uri>
			</author>
			<updated>2010-08-12T16:48:15Z</updated>
			<id>https://gprogs.com/viewtopic.php?pid=1627#p1627</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: SmoothEventReciever - error when key pressed]]></title>
			<link rel="alternate" href="https://gprogs.com/viewtopic.php?pid=1624#p1624" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>...
m_char_buf = m_char_buf[..m_char_buf.Dimensions()[0] + 1] 
m_char_buf[m_char_buf.Dimensions()[0] - 1] = key

m_key_buf_old[key] = m_key_buf[key]
m_key_buf[key] = event.getKeyPressedDown()
...</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Lobby]]></name>
				<uri>https://gprogs.com/profile.php?id=298</uri>
			</author>
			<updated>2010-08-12T11:51:36Z</updated>
			<id>https://gprogs.com/viewtopic.php?pid=1624#p1624</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: SmoothEventReciever - error when key pressed]]></title>
			<link rel="alternate" href="https://gprogs.com/viewtopic.php?pid=1490#p1490" />
			<content type="html"><![CDATA[]]></content>
			<author>
				<name><![CDATA[Kronos]]></name>
				<uri>https://gprogs.com/profile.php?id=267</uri>
			</author>
			<updated>2009-09-22T18:11:24Z</updated>
			<id>https://gprogs.com/viewtopic.php?pid=1490#p1490</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: SmoothEventReciever - error when key pressed]]></title>
			<link rel="alternate" href="https://gprogs.com/viewtopic.php?pid=1489#p1489" />
			<content type="html"><![CDATA[<p>greetings <img src="https://gprogs.com/img/smilies/smile.png" width="15" height="15" alt="smile" />&nbsp; my apologies on the response delay.&nbsp; unfortunately i am unable to replicate this issue.&nbsp; here is a modified hello world that prints keys pressed using the SmoothEventReceiver.&nbsp; please give it a whirl and see if you get the issue here as well.&nbsp; also, what version of BMAX are your running?&nbsp; what OS?&nbsp; we may need to rebuild mods.<br /></p><div class="codebox"><pre><code>SuperStrict
Framework Irrlicht.Core
Import Irrlicht.AddOns

?MacOS
Local device:IrrlichtDevice = ..
    IrrlichtDevice.Create(EDT_OPENGL, _DIMENSION2DI(640, 480), 16, ..
        False, False, False, Null)
?Not MacOS
Local device:IrrlichtDevice = ..
    IrrlichtDevice.Create(EDT_BURNINGVIDEO, _DIMENSION2DI(640, 480), 16, ..
        False, False, False, Null)
?

If Not device Then Return
        
device.setWindowCaption(&quot;Hello World! - Irrlicht Engine Demo&quot;)

Local Receiver:SmoothEventReceiver = SmoothEventReceiver.createReceiver()
device.setEventReceiver(Receiver)

Local driver:IVideoDriver = device.getVideoDriver()
Local smgr:ISceneManager = device.getSceneManager()
Local guienv:IGUIEnvironment = device.getGUIEnvironment()

guienv.addStaticText(&quot;Hello World! This is the Irrlicht Software renderer!&quot;, ..
    _RECTI(10,10,260,22), True)
    
Local mesh:IAnimatedMesh = smgr.getMesh(&quot;../../media/sydney.md2&quot;)
If Not mesh Then Return
Local node:IAnimatedMeshSceneNode = smgr.addAnimatedMeshSceneNode( mesh )

If node
    node.setMaterialFlag(EMF_LIGHTING, False)
    node.setMD2AnimationFromType ( EMAT_STAND )
    node.setMaterialTexture( 0, driver.getTexture(&quot;../../media/sydney.bmp&quot;) )
EndIf

smgr.addCameraSceneNode(Null, _VECTOR3DF(0,30,-40), _VECTOR3DF(0,5,0))

While device.run() 

    driver.beginScene(True, True, _SCOLOR(255,100,101,140))

    smgr.drawAll()
    guienv.drawAll()

    Local key:Int = Receiver.popkey()
    Print key

    driver.endScene()
EndWhile

device.drop()</code></pre></div>]]></content>
			<author>
				<name><![CDATA[gman]]></name>
				<uri>https://gprogs.com/profile.php?id=2</uri>
			</author>
			<updated>2009-09-22T12:03:58Z</updated>
			<id>https://gprogs.com/viewtopic.php?pid=1489#p1489</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[SmoothEventReciever - error when key pressed]]></title>
			<link rel="alternate" href="https://gprogs.com/viewtopic.php?pid=1486#p1486" />
			<content type="html"><![CDATA[<p>Im using the latest addons.zip 2008 06 09 with irrlicht 1.5.1. and Blitzmax 1.34. I get an error when I press any key .&quot;Unhandled Exception:Attempt to index array element beyond array length.</p><p>on 5th line of OnEvent Method</p><div class="codebox"><pre><code>&#039; push the key
            m_char_buf = m_char_buf[..m_char_buf.Dimensions()[0] + 1]  &lt;- here!!
            m_char_buf[m_char_buf.Dimensions()[0] - 1] = key
        
            m_key_buf_old[key] = m_key_buf[key]
            m_key_buf[key] = event.getKeyPressedDown()</code></pre></div><p>I created the receiver with:-</p><div class="codebox"><pre><code>Receiver:SmoothEventReceiver = SmoothEventReceiver.createReceiver()
device.setEventReceiver(Receiver)</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Kronos]]></name>
				<uri>https://gprogs.com/profile.php?id=267</uri>
			</author>
			<updated>2009-09-18T16:29:21Z</updated>
			<id>https://gprogs.com/viewtopic.php?pid=1486#p1486</id>
		</entry>
</feed>
