<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: 3. OpenGL Keyboard Interaction (Version 2.0)</title>
	<atom:link href="http://www.swiftless.com/tutorials/opengl/keyboard.html/feed" rel="self" type="application/rss+xml" />
	<link>http://www.swiftless.com/tutorials/opengl/keyboard.html</link>
	<description>Game Programming and Computer Graphics Tutorials</description>
	<lastBuildDate>Wed, 01 Feb 2012 09:19:36 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Rowan</title>
		<link>http://www.swiftless.com/tutorials/opengl/keyboard.html/comment-page-1#comment-3672</link>
		<dc:creator>Rowan</dc:creator>
		<pubDate>Tue, 13 Dec 2011 16:57:32 +0000</pubDate>
		<guid isPermaLink="false">http://swiftless.com/wordpress/?p=101#comment-3672</guid>
		<description>I hope you are still replying to these. I have a problem where the keyboard command doesn&#039;t update until a new key is pressed. If it would help i could send you the code. Thanks</description>
		<content:encoded><![CDATA[<p>I hope you are still replying to these. I have a problem where the keyboard command doesn&#8217;t update until a new key is pressed. If it would help i could send you the code. Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Swiftless</title>
		<link>http://www.swiftless.com/tutorials/opengl/keyboard.html/comment-page-1#comment-2257</link>
		<dc:creator>Swiftless</dc:creator>
		<pubDate>Sun, 11 Sep 2011 12:21:45 +0000</pubDate>
		<guid isPermaLink="false">http://swiftless.com/wordpress/?p=101#comment-2257</guid>
		<description>Hi Alex,

Thanks for that! Definitely handy for confirming this will work.

Cheers,
Swiftless</description>
		<content:encoded><![CDATA[<p>Hi Alex,</p>
<p>Thanks for that! Definitely handy for confirming this will work.</p>
<p>Cheers,<br />
Swiftless</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: alex</title>
		<link>http://www.swiftless.com/tutorials/opengl/keyboard.html/comment-page-1#comment-2173</link>
		<dc:creator>alex</dc:creator>
		<pubDate>Sat, 27 Aug 2011 13:34:08 +0000</pubDate>
		<guid isPermaLink="false">http://swiftless.com/wordpress/?p=101#comment-2173</guid>
		<description>Hi. To handle multiple keys, you need to have the key repeat off. This can b done by adding &quot;glutSetKeyRepeat(GLUT_KEY_REPEAT_OFF);&quot; before the &quot;glutMainLoop()&quot; call. 
Key repeat might be off by default for most people, but for me (and others) it wasn&#039;t (this was on linux).</description>
		<content:encoded><![CDATA[<p>Hi. To handle multiple keys, you need to have the key repeat off. This can b done by adding &#8220;glutSetKeyRepeat(GLUT_KEY_REPEAT_OFF);&#8221; before the &#8220;glutMainLoop()&#8221; call.<br />
Key repeat might be off by default for most people, but for me (and others) it wasn&#8217;t (this was on linux).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: arcodist</title>
		<link>http://www.swiftless.com/tutorials/opengl/keyboard.html/comment-page-1#comment-2069</link>
		<dc:creator>arcodist</dc:creator>
		<pubDate>Fri, 12 Aug 2011 08:41:33 +0000</pubDate>
		<guid isPermaLink="false">http://swiftless.com/wordpress/?p=101#comment-2069</guid>
		<description>thank you for your tutorials, they really help me a lot! Hope you keep updating your tutorial, it&#039;s awesome!</description>
		<content:encoded><![CDATA[<p>thank you for your tutorials, they really help me a lot! Hope you keep updating your tutorial, it&#8217;s awesome!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Venktesh</title>
		<link>http://www.swiftless.com/tutorials/opengl/keyboard.html/comment-page-1#comment-1740</link>
		<dc:creator>Venktesh</dc:creator>
		<pubDate>Tue, 07 Jun 2011 18:15:49 +0000</pubDate>
		<guid isPermaLink="false">http://swiftless.com/wordpress/?p=101#comment-1740</guid>
		<description>Hi
I had a problem working with keys in my project.
I need the gl cube to rotate when a key is pressed by the user.
I tried using the function described above(ought to say its good tutorial. :) ) but I am stuck with what to use as the case of switch statement.
Like I want the cube to rotate clockwise by 5 degrees when &#039;w&#039; key is pressed. I increased the angle variable by 5.0f of the function glRotatef() and called again the function glutDisplayFunc(drawScene).. But there is no effect of pressing it. 

Someone please help
thanks</description>
		<content:encoded><![CDATA[<p>Hi<br />
I had a problem working with keys in my project.<br />
I need the gl cube to rotate when a key is pressed by the user.<br />
I tried using the function described above(ought to say its good tutorial. <img src='http://www.swiftless.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ) but I am stuck with what to use as the case of switch statement.<br />
Like I want the cube to rotate clockwise by 5 degrees when &#8216;w&#8217; key is pressed. I increased the angle variable by 5.0f of the function glRotatef() and called again the function glutDisplayFunc(drawScene).. But there is no effect of pressing it. </p>
<p>Someone please help<br />
thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: prasad</title>
		<link>http://www.swiftless.com/tutorials/opengl/keyboard.html/comment-page-1#comment-1630</link>
		<dc:creator>prasad</dc:creator>
		<pubDate>Tue, 26 Apr 2011 19:29:16 +0000</pubDate>
		<guid isPermaLink="false">http://swiftless.com/wordpress/?p=101#comment-1630</guid>
		<description>hi its good</description>
		<content:encoded><![CDATA[<p>hi its good</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Swiftless</title>
		<link>http://www.swiftless.com/tutorials/opengl/keyboard.html/comment-page-1#comment-1619</link>
		<dc:creator>Swiftless</dc:creator>
		<pubDate>Thu, 21 Apr 2011 00:59:09 +0000</pubDate>
		<guid isPermaLink="false">http://swiftless.com/wordpress/?p=101#comment-1619</guid>
		<description>Hi Fiona,

It sounds like when we setup the array, it is not being initialised to all values being 0. In the comments it has already been mentioned that there should be another loop in the code that specifically sets all parts of the array to 0/false before it is used.

Cheers,
Swiftless</description>
		<content:encoded><![CDATA[<p>Hi Fiona,</p>
<p>It sounds like when we setup the array, it is not being initialised to all values being 0. In the comments it has already been mentioned that there should be another loop in the code that specifically sets all parts of the array to 0/false before it is used.</p>
<p>Cheers,<br />
Swiftless</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fiona</title>
		<link>http://www.swiftless.com/tutorials/opengl/keyboard.html/comment-page-1#comment-1614</link>
		<dc:creator>Fiona</dc:creator>
		<pubDate>Tue, 19 Apr 2011 12:20:57 +0000</pubDate>
		<guid isPermaLink="false">http://swiftless.com/wordpress/?p=101#comment-1614</guid>
		<description>Hi, I copy paste your tutorial and found a problem. Every time my program is being run, &#039;A&#039; is always in the state of being pressed (I perform operation printing in the console to identify this problem). I assume boolean is always being initialized as &quot;true&quot; (though when printed it in the console, 205 value appears).

Swapping the true-false, solve the problem though:

void keyPressed(unsigned char key, int x, int y){
	keyStates[key] = false; //instead of true
}

void keyUp(unsigned char key, int x, int y){
	keyStates[key] = true; //instead of false
}

void keyOperations(void){
	if(!keyStates[&#039;a&#039;]){
		//If false, perform some operations
	}
}</description>
		<content:encoded><![CDATA[<p>Hi, I copy paste your tutorial and found a problem. Every time my program is being run, &#8216;A&#8217; is always in the state of being pressed (I perform operation printing in the console to identify this problem). I assume boolean is always being initialized as &#8220;true&#8221; (though when printed it in the console, 205 value appears).</p>
<p>Swapping the true-false, solve the problem though:</p>
<p>void keyPressed(unsigned char key, int x, int y){<br />
	keyStates[key] = false; //instead of true<br />
}</p>
<p>void keyUp(unsigned char key, int x, int y){<br />
	keyStates[key] = true; //instead of false<br />
}</p>
<p>void keyOperations(void){<br />
	if(!keyStates['a']){<br />
		//If false, perform some operations<br />
	}<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: oldnewbie</title>
		<link>http://www.swiftless.com/tutorials/opengl/keyboard.html/comment-page-1#comment-1559</link>
		<dc:creator>oldnewbie</dc:creator>
		<pubDate>Sat, 12 Mar 2011 04:50:00 +0000</pubDate>
		<guid isPermaLink="false">http://swiftless.com/wordpress/?p=101#comment-1559</guid>
		<description>Another good tutorial.But readers must be aware of the fact that key functions are incomplete.They shouldn&#039;t complain for no-response on keypresses.Because this tutorial(as I understood) is intended to be a pre-work for further tutorials.I say this because there are such readers.Anyway,thanks.</description>
		<content:encoded><![CDATA[<p>Another good tutorial.But readers must be aware of the fact that key functions are incomplete.They shouldn&#8217;t complain for no-response on keypresses.Because this tutorial(as I understood) is intended to be a pre-work for further tutorials.I say this because there are such readers.Anyway,thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Swiftless</title>
		<link>http://www.swiftless.com/tutorials/opengl/keyboard.html/comment-page-1#comment-1446</link>
		<dc:creator>Swiftless</dc:creator>
		<pubDate>Fri, 31 Dec 2010 06:59:06 +0000</pubDate>
		<guid isPermaLink="false">http://swiftless.com/wordpress/?p=101#comment-1446</guid>
		<description>Hi Pratibha,

To move shapes, you need to use variables which store the position of the shape (x, y, z) coordinates and then use the glTranslate functions with these variables. 

Use the keyboard controls to update the position variables.

Cheers,
Swiftless</description>
		<content:encoded><![CDATA[<p>Hi Pratibha,</p>
<p>To move shapes, you need to use variables which store the position of the shape (x, y, z) coordinates and then use the glTranslate functions with these variables. </p>
<p>Use the keyboard controls to update the position variables.</p>
<p>Cheers,<br />
Swiftless</p>
]]></content:encoded>
	</item>
</channel>
</rss>

