<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>readkey() and sticking</title>
		<link>http://www.allegro.cc/forums/view/590250</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Mon, 26 Feb 2007 02:38:42 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;m trying to use readkey to move a character across the screen. If you hold down the key, it backlogs the keyboard. Is there any way to clear the keyboard buffer? Like keyboard_clear() or something like that?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SkaxCo)</author>
		<pubDate>Sun, 25 Feb 2007 03:38:51 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p><span class="source-code"><a href="http://www.allegro.cc/manual/clear_keybuf" target="_blank"><span class="a">clear_keybuf</span></a></span>R.T.F.M...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kauhiz)</author>
		<pubDate>Sun, 25 Feb 2007 03:46:13 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thanks
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SkaxCo)</author>
		<pubDate>Sun, 25 Feb 2007 03:47:31 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Sorry, edited
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kauhiz)</author>
		<pubDate>Sun, 25 Feb 2007 03:47:57 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;m putting in a little question: when would clear_keybuf be needed? because i&#39;ve never used it and everything works great..?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Albin Engström)</author>
		<pubDate>Sun, 25 Feb 2007 05:31:08 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>...Please just RTFM, please!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kauhiz)</author>
		<pubDate>Sun, 25 Feb 2007 05:42:39 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>If you&#39;re using readkey() for movement, EXPECT backlog.</p><p>You want to be reading the key[] array instead if you want constant movement.</p><p>If however you want the ability to move single spaces AND constantly, one method you can do is to check both readkey() and key[] at the same time and only move the character if BOTH return the appropriate value.</p><p>--- Kris Asick (Gemini)<br />--- <a href="http://www.pixelships.com">http://www.pixelships.com</a>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kris Asick)</author>
		<pubDate>Sun, 25 Feb 2007 06:56:59 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Kris Asick: Noted, thanks.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Albin Engström)</author>
		<pubDate>Sun, 25 Feb 2007 17:25:01 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>For some applications, you might want to set the delay and repeat rates, with set_keyboard_rate(delay, repeat). Default is 250, 33 (milliseconds). You might  want to set it for high speed and use rest() to slow it down where necesary, to vary the speed as the program may require. </p><p>But clear_keybuf() is definitely useful for the problem you mentioned. I use in  my text editors to reprevent buffer overload when scrolling.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Bill Morris)</author>
		<pubDate>Mon, 26 Feb 2007 02:34:33 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>... no. For the situation the OP mentioned, the key[] array is the way to go. And you basically <i>never</i> want to use rest() except to yield to the OS.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (gnolam)</author>
		<pubDate>Mon, 26 Feb 2007 02:38:42 +0000</pubDate>
	</item>
</rss>
