<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>5.1 SVN, Windows: keyboard state, wrong modifier flags, patch</title>
		<link>http://www.allegro.cc/forums/view/610504</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Wed, 04 Jul 2012 15:42:00 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p><b>UPDATE</b><br />Ignore all patches in this thread. A patch has been submitted to the developer mailing list.<br /><b>END OF UPDATE</b></p><p>Patch is attached. <span class="ref"><sup>[<a href="#">1</a>]</sup></span></p><p><u>Reproducing/Demonstrating the problem without patch:</u></p><p>1.) Run ex_keyboard_events in Windows.</p><p>2.) Press and hold SHIFT+P in the main Window and see how the modifier flags and the keyboard events are correctly displayed in the log.</p><p>3.) While still holding the keys from step 2, switch away from the main window by clicking something else.</p><p>4.) Release all keys.</p><p>5.) Click back into the main window and press any key and see how the SHIFT modifier flag is incorrect.</p><p><u>Patch Description:</u><br />The patch causes the entire keyboard state and modifier and toggle modifier flags to be reread and translated from a Windows API call upon switching back into the window to fix the key state (especially the modifier flags) from being out of sync with the current physical keyboard state.</p><p>The patch does not clear the keyboard state on switching out to achieve consistency with an event based handling (where you would not receive KEY_UP messages either if you switch away while you&#39;re still holding down something).</p><p>I also added some modifier flags which seemed to be missing in the function which handled modifier flag updates (special L/RWIN keys and MENU key).</p><p><u>Demonstrating the fix after patching:</u><br />Do everything as in pre-patch except in step 5 observe how the modifier flag is correct.</p><p><b>Someone should test and confirm, before committing this.</b><br />I tested on Windows 7. It may not work correctly in Wine.
</p><div class="ref-block"><h2>References</h2><ol><li><a href="http://www.allegro.cc/files/attachment/606192">http://www.allegro.cc/files/attachment/606192</a></li></ol></div></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dennis)</author>
		<pubDate>Sun, 24 Jun 2012 20:05:16 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Sigh.  Let me try to explain.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p> Numpad Enter does work and sets the state flag for both the normal Enter and the Numpad Enter whereas the normal Enter only sets the state for the normal Enter and not the Numpad Enter, so if you test the state flag for Numpad Enter you can be sure that&#39;s what was pressed.</p></div></div><p>So if the numpad Enter was pressed, I get the other Enter as a bonus? That&#39;s just wrong. I don&#39;t want to special case the Enter keys in my game, I want Allegro to take care of it.  And currently it does that just fine.</p><p>From reading MSDN docs, I&#39;m pretty sure that neither GetKeyboardState, GetKeyState, nor GetAsyncKeyState can actually do what you want here, as there is no bit for the extended key flag.  In other words, <u>this cannot be done properly</u>.</p><p>What I think you should do is this:
</p><ol><li><p>Clear all keys.
</p></li><li><p>Update the toggle modifier keys.</p></li></ol><p>Nothing more. Don&#39;t update the non-toggle modifiers either, just clear everything.  It&#39;s consistent, less code, easier to maintain.  And games don&#39;t use the modifier keys as modifiers, they just use them as any other key.</p><p>Another thing you can do: Update the toggle modifiers in the keyboard driver initialization, this is missing. And, yes add the missing keys in update_modifiers.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (torhu)</author>
		<pubDate>Mon, 25 Jun 2012 00:22:17 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>torhu, you&#39;re quoting information I wrote about the old, wrong patch, which is why I won&#39;t respond to that here.</p><p>This patch is entirely new and does not do what the old patch did. </p><p>It only addresses what is described in the first post of THIS thread. Nothing more, nothing less.</p><p>If there are other issues, I need a clean description of the problem and the steps necessary to reproduce the erroneous behavior before I can patch it.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dennis)</author>
		<pubDate>Mon, 25 Jun 2012 00:38:24 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I did read your new patch before replying, and it does update the keys in basically the same way.  So what I said still applies.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (torhu)</author>
		<pubDate>Mon, 25 Jun 2012 01:01:36 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Your examination of the new patch can not have been very thorough then as it clearly does additional things and some things different and also, what&#39;s more important, does it only on switching-in and not all the time like the old wrong patch (which was addressing different issues that this one is not addressing).</p><p>Clearing the state on switching out would cause an inconsistency with the event system:<br />If your keyboard handling code is based on events then if you switch away, you do not get a key-up message for any keys being depressed while switching away.<br />This is why that is not addressed in this patch. If the state would be cleared on switching out, keeping consistency would mean to also generate key-up messages on switching out.</p><p>I repeat again: This patch only fixes the wrong modifier flags as described in the OP.</p><p>I also repeat again: The information from the old thread you quoted does NOT apply to this patch. The behavior is different.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dennis)</author>
		<pubDate>Mon, 25 Jun 2012 01:09:37 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/610504/958458#target">Dennis</a> said:</div><div class="quote"><p> Clearing the state on switching out would cause an inconsistency with the event system:</p></div></div><p>Unless you generate &quot;fake&quot; events to sync it up, the state and the events will be out of sync anyway.  This is not a big deal.  <u>Just forget about this.</u></p><p>I think that you need to stop for a bit, go back and actually <u>read and understand the code, starting <a href="https://github.com/elias-pschernig/allegro5/blob/master/src/win/wkeyboard.c#L295">here</a></u>.</p><p>And then do some testing with ex_keyboard_events, pressing different kinds of keys on your keyboard.  See what ALLEGRO_KEY_* codes they generate.  Especially the extended keys, and the numpad keys, with Num Lock on and off, etc.  <u>Because your patch does not give the same ALLEGRO_KEY constants as the event system does</u>.</p><p>Please make some effort to understand how things work.  It&#39;s hard to create a good patch if you don&#39;t know what you are doing.  I improved and bugfixed some of the Allegro Windows code, and to do that I had have a good understanding of it.  <u>I am not making things up when I say that your patch has problems.</u>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (torhu)</author>
		<pubDate>Mon, 25 Jun 2012 02:13:24 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Maybe since you have a better understanding of the problems involved, you could make the necessary fixes?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Mon, 25 Jun 2012 02:32:43 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I guess, but I shouldn&#39;t be coding since my left shoulder is <span class="cuss"><span>fuck</span></span>ed up for the time being <img src="http://www.allegro.cc/forums/smileys/undecided.gif" alt=":-/" /></p><p>I thought I had given pretty exact intructions how to do this, but I don&#39;t seem to get through <img src="http://www.allegro.cc/forums/smileys/huh.gif" alt="???" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (torhu)</author>
		<pubDate>Mon, 25 Jun 2012 02:51:29 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>torhu: Are you saying when returning after the switch, we should not use GetKeyboardState() but another function to update the state?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Elias)</author>
		<pubDate>Mon, 25 Jun 2012 02:59:56 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>No.  The state cannot be properly updated, so don&#39;t try either.  See <a href="http://www.allegro.cc/forums/thread/610504/958451#target">this</a>.</p><p>EDIT:<br />Well, there is the possibility that the array that GetKeyboardState returns actually contain all the keys, even the ones that don&#39;t have their own VK codes.  But someone would need to figure this out first.  In that case, it can be done.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (torhu)</author>
		<pubDate>Mon, 25 Jun 2012 03:04:10 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/610504/958451#target">torhu</a> said:</div><div class="quote"><p>2. Update the toggle modifier keys.</p></div></div><p>

From reading the patch it looks like that&#39;s what the GetKeyboardState() is for.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Elias)</author>
		<pubDate>Mon, 25 Jun 2012 03:07:25 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/610504/958468#target">torhu</a> said:</div><div class="quote"><p>I thought I had given pretty exact intructions how to do this, but I don&#39;t seem to get through</p></div></div><p>
The problem here is that in my opinion, you&#39;re displaying quite the annoying and immature attitude and I&#39;m tempted to simply ignore you (I am aware of the fact that this makes me seem immature as well but you&#39;re not exactly making this easy).</p><p>You also seem to fail at understanding the very limited scope and purpose of this small patch in this thread.</p><p>I also doubt you tested the new patch because if you had, you would have noticed that the state is being correctly reported by al_get_keyboard_state after switching back in because after the fire-just-once-on-switch-in update it is immediately based on the event maintained state afterwards which already was correct before the patch (before the old one which has already been reverted).</p><p>I explained why the state can not be cleared on switching out.</p><p>There are other issues. Those can be addressed in another patch outside of the scope of this one as described in the OP.</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/610504/958471#target">torhu</a> said:</div><div class="quote"><p>The state cannot be properly updated, so don&#39;t try either.</p></div></div><p>The state can be properly updated in that case, because the respective function to do so to acquire the state from the Windows API is called within the correct thread. Please stop spreading false information.</p><p>The only case where it would not work correctly (by system design) is when the Window does not have input focus. That&#39;s consistent with the event driven system however so it&#39;s a non-issue.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dennis)</author>
		<pubDate>Mon, 25 Jun 2012 03:08:27 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>This is from your patch.  Note how it loops over all the 256 elements.  Is this not the patch you are talking about?  This loop will cause the key state to be wrong, like I have been repeatedly trying to tell you.  What you need to to is to update only some of the keys.  I suggest only Scroll Lock, Num Lock and Caps Lock.  The update_toggle_modifiers function does this for you already.  Updating the other modifiers, is an option, but not much point IMHO.  Since you can&#39;t update all the keys correctly, I think it&#39;s better to make all keys (except the toggle modifiers) behave consistently.
</p><div class="source-code"><div class="toolbar"><span class="button numbers"><b>#</b></span><span class="button select">Select</span><span class="button expand">Expand</span></div><div class="inner"><span class="number">  1</span><span class="k3">+</span>   <span class="k1">if</span> <span class="k2">(</span>windowHandle <span class="k3">!</span><span class="k3">=</span> NULL<span class="k2">)</span> <span class="k2">{</span>
<span class="number">  2</span><span class="k3">+</span>     <span class="c">/* Get real most current state from Windows API call. */</span>
<span class="number">  3</span><span class="k3">+</span>     _al_win_wnd_call_proc<span class="k2">(</span>windowHandle, fill_windows_keyboard_state,
<span class="number">  4</span><span class="k3">+</span>        <span class="k3">&amp;</span>ret_val<span class="k2">)</span><span class="k2">;</span>
<span class="number">  5</span><span class="k3">+</span>     <span class="k1">if</span> <span class="k2">(</span>ret_val<span class="k2">)</span> <span class="k2">{</span>
<span class="number">  6</span><span class="k3">+</span>        <span class="c">/* Translate Windows key states to Allegro key states. */</span>
<span class="number">  7</span><span class="k3">+</span>        <span class="k1">for</span> <span class="k2">(</span>i <span class="k3">=</span> <span class="n">0</span><span class="k2">;</span> i <span class="k3">&lt;</span> <span class="n">256</span><span class="k2">;</span> i<span class="k3">+</span><span class="k3">+</span><span class="k2">)</span> <span class="k2">{</span>
<span class="number">  8</span><span class="k3">+</span>           <span class="k1">if</span> <span class="k2">(</span>win_key_state<span class="k2">[</span>i<span class="k2">]</span> <span class="k3">&amp;</span> <span class="n">0x80</span><span class="k2">)</span>
<span class="number">  9</span><span class="k3">+</span>              _AL_KEYBOARD_STATE_SET_KEY_DOWN<span class="k2">(</span>the_state, hw_to_mycode<span class="k2">[</span>i<span class="k2">]</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 10</span><span class="k3">+</span>           <span class="k1">else</span>
<span class="number"> 11</span><span class="k3">+</span>              _AL_KEYBOARD_STATE_CLEAR_KEY_DOWN<span class="k2">(</span>the_state, hw_to_mycode<span class="k2">[</span>i<span class="k2">]</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 12</span><span class="k3">+</span>        <span class="k2">}</span>
<span class="number"> 13</span><span class="k3">+</span>
<span class="number"> 14</span><span class="k3">+</span>        <span class="c">/* Update toggle modifier key flags. */</span>
<span class="number"> 15</span><span class="k3">+</span>        update_toggle_modifiers<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 16</span><span class="k3">+</span>
<span class="number"> 17</span><span class="k3">+</span>        <span class="c">/* Update modifier key flags. */</span>
<span class="number"> 18</span><span class="k3">+</span>        update_modifiers<span class="k2">(</span>ALLEGRO_KEY_LSHIFT, _AL_KEYBOARD_STATE_KEY_DOWN<span class="k2">(</span>the_state, ALLEGRO_KEY_LSHIFT<span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 19</span><span class="k3">+</span>        update_modifiers<span class="k2">(</span>ALLEGRO_KEY_RSHIFT, _AL_KEYBOARD_STATE_KEY_DOWN<span class="k2">(</span>the_state, ALLEGRO_KEY_RSHIFT<span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 20</span><span class="k3">+</span>        update_modifiers<span class="k2">(</span>ALLEGRO_KEY_LCTRL, _AL_KEYBOARD_STATE_KEY_DOWN<span class="k2">(</span>the_state, ALLEGRO_KEY_LCTRL<span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 21</span><span class="k3">+</span>        update_modifiers<span class="k2">(</span>ALLEGRO_KEY_RCTRL, _AL_KEYBOARD_STATE_KEY_DOWN<span class="k2">(</span>the_state, ALLEGRO_KEY_RCTRL<span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 22</span><span class="k3">+</span>        update_modifiers<span class="k2">(</span>ALLEGRO_KEY_ALT, _AL_KEYBOARD_STATE_KEY_DOWN<span class="k2">(</span>the_state, ALLEGRO_KEY_ALT<span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 23</span><span class="k3">+</span>        update_modifiers<span class="k2">(</span>ALLEGRO_KEY_ALTGR, _AL_KEYBOARD_STATE_KEY_DOWN<span class="k2">(</span>the_state, ALLEGRO_KEY_ALTGR<span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 24</span><span class="k3">+</span>        update_modifiers<span class="k2">(</span>ALLEGRO_KEY_LWIN, _AL_KEYBOARD_STATE_KEY_DOWN<span class="k2">(</span>the_state, ALLEGRO_KEY_LWIN<span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 25</span><span class="k3">+</span>        update_modifiers<span class="k2">(</span>ALLEGRO_KEY_RWIN, _AL_KEYBOARD_STATE_KEY_DOWN<span class="k2">(</span>the_state, ALLEGRO_KEY_RWIN<span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 26</span><span class="k3">+</span>        update_modifiers<span class="k2">(</span>ALLEGRO_KEY_MENU, _AL_KEYBOARD_STATE_KEY_DOWN<span class="k2">(</span>the_state, ALLEGRO_KEY_MENU<span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 27</span><span class="k3">+</span>     <span class="k2">}</span>
<span class="number"> 28</span><span class="k3">+</span>   <span class="k2">}</span>
</div></div><p>

I think we should just stop this here.  I will do it later this summer.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (torhu)</author>
		<pubDate>Mon, 25 Jun 2012 03:23:40 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/610504/958475#target">torhu</a> said:</div><div class="quote"><p>This loop will cause the key state to be wrong, like I have been repeatedly trying to tell you.</p></div></div><p>No, it does cause the key state to be synchronized with the key state that the windowing system (Windows) <i>intends</i> for the application. </p><p>An application is not intended/supposed (by the system) to know of any keys being pressed while it does not have input focus. It is also not supposed to get key up messages while it does not have input focus. It is only supposed to know the last state as it was when it lost focus.</p><p>When it gets focus back it is only natural that you need to press a key again to get another key down message or in this case an updated state (which you will get correctly even by al_get_keyboard_state because the Windows events will update the state after that initial correction).</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>Updating the other modifiers, is an option, but not much point IMHO. </p></div></div><p>It&#39;s not optional. If shift is not pressed anymore after switching back in, pressing just P should not still report shift. That&#39;s what this patch fixes.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dennis)</author>
		<pubDate>Mon, 25 Jun 2012 03:37:15 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/610504/958475#target">torhu</a> said:</div><div class="quote"><p>Updating the other modifiers, is an option, but not much point IMHO.</p></div></div><p>

So you are suggesting that in the initial example, when you press P, the .modifiers field of the event should have the SHIFT bit set, even though shift is not pressed?</p><p>It&#39;s a very minor issue of course, but it seems to make more sense to not set it (and it&#39;s also what we do under X11).
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Elias)</author>
		<pubDate>Mon, 25 Jun 2012 03:50:07 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>There are other issues (which I repeat, this patch does not address, I lost count how many times I stressed that).</p><p>For example, if a key is being held while switching in, the event system never gets a key-down and thus it can&#39;t be correctly reported in the state. <br />To fix that the hw_to_mycode array would have to be further decoded/filled but then al_get_keyboard_state would be more accurate than the event system causing another inconsistency, unless we&#39;d also use the information from them to generate a couple of fake (Allegro)events after switching in.</p><p>This would then not be consistent with the default behavior of Windows applications only relying on (Windows)event (not Allegro Events) based input.</p><p>But again, that will have to be fixed in a separate patch.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dennis)</author>
		<pubDate>Mon, 25 Jun 2012 03:56:43 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/610504/958451#target">torhu</a> said:</div><div class="quote"><p>What I think you should do is this:</p><p>Clear all keys.</p></div></div><p>So wait, if you hold a key down, switch away, and switch back in, that key is now no longer pressed according to allegro or the app? I don&#39;t think that makes as much sense as you think it does. Broken key state ftl.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Mon, 25 Jun 2012 04:37:32 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Okay, looks like I&#39;ll be up all night anyway...</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/610504/958476#target">Dennis</a> said:</div><div class="quote"><p> If shift is not pressed anymore after switching back in, pressing just P should not still report shift.</p></div></div><p>Is this your original issue?  Like said earlier: just clear the state (as in the_state) on switch in.  With a single call to memset().  That&#39;s it.  In addition, I would call update_toggle_modifiers().</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/610504/958486#target">Thomas Fjellstrom</a> said:</div><div class="quote"><p> So wait, if you hold a key down, switch away, and switch back in, that key is now no longer pressed according to allegro or the app? I don&#39;t think that makes as much sense as you think it does. Broken key state ftl.
</p></div></div><p>Now I think you&#39;re just looking for mistakes in my posts <img src="http://www.allegro.cc/forums/smileys/rolleyes.gif" alt="::)" /> Like I said: Windows does not seem to give you enough information to do this through the keyboard state API.  Only through window (WM_KEYDOWN etc.) messages. Would be nice if it did, but finding out requires testing as it&#39;s not documented.  And I think just clearing all keys (except the 3 toggle modifiers) is a good solution, instead of updating some keys but not others.</p><p>Just for fun I tried confusing the Allegro 4 game Saucelifter by switching in/out while holding keys, etc.  And it didn&#39;t take much to mess it up.  This is just for illustrating the problem, I know we are talking about Allegro 5. It&#39;s just not going to be perfect no matter what we do. But it can be made a bit less noticeable.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (torhu)</author>
		<pubDate>Mon, 25 Jun 2012 05:16:08 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/610504/958488#target">torhu</a> said:</div><div class="quote"><p>Now I think you&#39;re just looking for mistakes in my posts </p></div></div><p>Not in your posts, but in what you think might be a good solution.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>Windows does not seem to give you enough information to do this through the keyboard state API.</p></div></div><p>So the state API doesn&#39;t give you the current state of the keyboard? That seems a bit broken. Maybe I&#39;m misunderstanding what you&#39;re talking about here.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>Only through window (WM_KEYDOWN etc.) messages.</p></div></div><p>I <i>must</i> be misunderstanding what you&#39;re talking about. As WM_KEY events are <i>very</i> broken afaik. It won&#39;t send key up events if a key was released outside of the app. Where as, the key state stuff should tell you what the current state is. </p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>And I think just clearing all keys (except the 3 toggle modifiers) is a good solution, instead of updating some keys but not others.</p></div></div><p>But that leads to very broken state. I think we should fix it, rather than leaving it broken.</p><p>In either case, I don&#39;t think allegro should be reporting broken state at all. If allegro&#39;s view of the state doesn&#39;t match the actual state of the keyboard (regardless of what windows may say it is at any given time via WM_KEY events), its just broken, and needs to be fixed. Even if that means patching up the key state, and sending synthesized events.</p><p>To be honest, I think the Allegro 5 key state api was a bad idea to begin with.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Mon, 25 Jun 2012 05:27:00 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/610504/958489#target">Thomas Fjellstrom</a> said:</div><div class="quote"><p> So the state API doesn&#39;t give you the current state of the keyboard? That seems a bit broken. Maybe I&#39;m misunderstanding what you&#39;re talking about here.
</p></div></div><p>Of course it does.  It&#39;s just that Allegro presents a different view of the keyboard, which requires some extra information to create (I have already explained this, please don&#39;t ask again).  The Windows keyboard state stuff is probably very old, and they haven&#39;t updated the API to match the capabilites of the window message system.  Maybe because they expect people to use one of the event/message systems instead.  Which is what both A4 (yes, it does) and A5 does.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p> In either case, I don&#39;t think allegro should be reporting broken state at all. If allegro&#39;s view of the state doesn&#39;t match the actual state of the keyboard (regardless of what windows may say it is at any given time via WM_KEY events), its just broken, and needs to be fixed. Even if that means patching up the key state, and sending synthesized events.</p></div></div><p>It&#39;s not really broken.  It&#39;s just that you can&#39;t hold down a key while switching to your A5 game and expect it to register.  You switch to it, then start playing. Not a big deal, and I wouldn&#39;t be surprised if many non-Allegro games behave like this.  It&#39;s just that you don&#39;t notice, because you generally don&#39;t do this unless you are testing you keyboard input system <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" /></p><p>What you would notice is keys that get &quot;stuck&quot; in the pressed state.  Clearing the key state fixes that.  Which is why I keep suggesting it.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p> I must be misunderstanding what you&#39;re talking about. As WM_KEY events are very broken afaik. It won&#39;t send key up events if a key was released outside of the app. Where as, the key state stuff should tell you what the current state is. 
</p></div></div><p>Does other GUI systems do this?  I have no idea. That&#39;s a different discussion than this anyway. At least it&#39;s a different patch.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (torhu)</author>
		<pubDate>Mon, 25 Jun 2012 05:50:35 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/610504/958492#target">torhu</a> said:</div><div class="quote"><p>(I have already explained this, please don&#39;t ask again)</p></div></div><p>If you&#39;re going to be as antagonistic as you have been in the past couple threads, why should I bother go read your rather negative posts?</p><p>Especially considering you conveniently push aside points others bring up and claim they aren&#39;t an issue, but YOUR problems are all important <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" /></p><p>Give us a calm and thorough explanation of all the issues, and maybe we&#39;ll take your word for it.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Mon, 25 Jun 2012 06:11:06 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>This code is taken from the &#39;key pressed&#39; event handler in wkeyboard.c that torhu linked to:
</p><div class="source-code snippet"><div class="inner"><pre>   <span class="c">/* Check for an extended key first. */</span>
   my_code <span class="k3">=</span> <span class="n">0</span><span class="k2">;</span>
   <span class="k1">if</span> <span class="k2">(</span>extended<span class="k2">)</span>
      my_code <span class="k3">=</span> extkey_to_keycode<span class="k2">(</span>vcode<span class="k2">)</span><span class="k2">;</span>

   <span class="c">/* Map a non-extended key.  This also works as a fallback in case</span>
<span class="c">      the key was extended, but no extended mapping was found. */</span>
   <span class="k1">if</span> <span class="k2">(</span>my_code <span class="k3">=</span><span class="k3">=</span> <span class="n">0</span><span class="k2">)</span> <span class="k2">{</span>
      <span class="k1">if</span> <span class="k2">(</span>vcode <span class="k3">=</span><span class="k3">=</span> VK_SHIFT<span class="k2">)</span> <span class="c">/* Left or right Shift key? */</span>
         vcode <span class="k3">=</span> MapVirtualKey<span class="k2">(</span>scode, MAPVK_VSC_TO_VK_EX<span class="k2">)</span><span class="k2">;</span>
      my_code <span class="k3">=</span> hw_to_mycode<span class="k2">[</span>vcode<span class="k2">]</span><span class="k2">;</span>
   <span class="k2">}</span>
</pre></div></div><p>
Allegro aims to represent ALLEGRO_KEY_ENTER and ALLEGRO_KEY_PAD_ENTER as two entirely separate keys. But let&#39;s look at how Allegro does that:
</p><ul><li><p>We get ALLEGRO_KEY_PAD_ENTER from the &#39;extkey_to_keycode&#39; function in the case where vcode is &#39;VK_RETURN&#39;. This only happens if &#39;extended&#39; is set.
</p></li><li><p>We get ALLEGRO_KEY_ENTER from the &#39;hw_to_mycode&#39; array, which is only used if the &#39;extkey_to_keycode&#39; part didn&#39;t work correctly. So it doesn&#39;t happen if my_code has already been set to ALLEGRO_KEY_PAD_ENTER.
</p></li><li><p>ALLEGRO_KEY_ENTER appears in slot 0x0D. I checked, and VK_RETURN is 0x0D. So Windows must provide both Enter keys via the same VK_ constant, but with an &#39;extended&#39; boolean to differentiate.</p></li></ul><p>This is from Dennis&#39;s patch:
</p><div class="source-code snippet"><div class="inner"><pre><span class="k3">+</span>        <span class="k1">for</span> <span class="k2">(</span>i <span class="k3">=</span> <span class="n">0</span><span class="k2">;</span> i <span class="k3">&lt;</span> <span class="n">256</span><span class="k2">;</span> i<span class="k3">+</span><span class="k3">+</span><span class="k2">)</span> <span class="k2">{</span>
<span class="k3">+</span>           <span class="k1">if</span> <span class="k2">(</span>win_key_state<span class="k2">[</span>i<span class="k2">]</span> <span class="k3">&amp;</span> <span class="n">0x80</span><span class="k2">)</span>
<span class="k3">+</span>              _AL_KEYBOARD_STATE_SET_KEY_DOWN<span class="k2">(</span>the_state, hw_to_mycode<span class="k2">[</span>i<span class="k2">]</span><span class="k2">)</span><span class="k2">;</span>
<span class="k3">+</span>           <span class="k1">else</span>
<span class="k3">+</span>              _AL_KEYBOARD_STATE_CLEAR_KEY_DOWN<span class="k2">(</span>the_state, hw_to_mycode<span class="k2">[</span>i<span class="k2">]</span><span class="k2">)</span><span class="k2">;</span>
<span class="k3">+</span>        <span class="k2">}</span>
</pre></div></div><p>
When that loop hits i==0x0D, it will update ALLEGRO_KEY_ENTER. But it&#39;s possible that Windows will have set win_key_state[0x0D] if ALLEGRO_KEY_PAD_ENTER is held down. If so, then ALLEGRO_KEY_ENTER will be set incorrectly. Have you checked for this?</p><p>Even if the loop doesn&#39;t introduce an error here, it is still incomplete, as it will never set the entry for ALLEGRO_KEY_PAD_ENTER (because ALLEGRO_KEY_PAD_ENTER doesn&#39;t appear in the hw_to_mycode array).</p><p>(The other thing I was going to mention is that the loop indiscriminately writes garbage to the_state[0] for all the keys with no entries in hw_to_mycode, but then, the existing code does that too.)</p><p>Right - now that all that is said:</p><p>torhu, you&#39;re in danger of driving away a possible contributor. You could tweak your explaining-fu as follows:
</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/610504/958451#target">torhu</a> said:</div><div class="quote"><p>
So if the numpad Enter was pressed, I get the other Enter as a bonus? That&#39;s just wrong. I don&#39;t want to special case the Enter keys in my game, I want Allegro to take care of it. And currently it does that just fine.
</p></div></div><p>
You&#39;ve stated that Allegro &quot;takes care of it&quot; so you don&#39;t have to &quot;special case the Enter keys&quot;. You should say exactly what Allegro does, which is to treat the Enter keys as separate unrelated keys.
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
From reading MSDN docs, I&#39;m pretty sure that neither GetKeyboardState, GetKeyState, nor GetAsyncKeyState can actually do what you want here, as there is no bit for the extended key flag.
</p></div></div><p>
In order for this to make sense, you have to explain what the extended key flag is.
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
In other words, <u>this cannot be done properly</u>.
</p></div></div><p>
If you don&#39;t get through, don&#39;t shout louder. On the contrary, if you make the effort to explain, then Dennis will either reach the same conclusion or win you over to his view, and no one will need to use any underlines.</p><p>You&#39;re absolutely right to defend Allegro 5&#39;s best interests - don&#39;t stop doing that - just find a more diplomatic way to do it. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /></p><p>[APPEND]<br />Tomasu, Dennis and elias, on the subject of broken state:</p><p>If I&#39;m playing a game and something like Windows Update or a calendar reminder pops up and steals focus, then there are a number of things I&#39;d like the game to do:
</p><ul><li><p>Pause if it&#39;s a real-time game - this is ideal and can be accomplished if the game uses events. It can hook the &#39;focus lost&#39; event.
</p></li><li><p>Release all keys if it&#39;s a non-real-time game - then I don&#39;t run the risk of a &#39;use resource&#39; operation auto-repeating, a puzzle map scrolling way further than I wanted it to, etc.
</p></li></ul><p>When I go back to the game, I will happily release and re-press a key if I was holding it and it doesn&#39;t respond the first time. This is accepted behaviour, as is very rare anyway since the default physical state of a keyboard is &#39;all keys up&#39; anyway.</p><p>On the other hand, if my player is moving to the right the whole time, it isn&#39;t intuitive to have to press the right arrow again to stop the movement. I usually naturally try to fix it by pressing the left arrow first a few times, which you can imagine accomplishes nothing and is quite frustrating.</p><p>So pragmatically speaking, the &#39;broken state&#39; torhu is recommending is a very practical option that will make all real users happy. It&#39;s a perfectly good solution if Dennis&#39;s approach can&#39;t be implemented safely, and it&#39;s definitely better than accidentally setting state for a key that isn&#39;t held down.</p><p>(Nothing wrong with the state API. Just fix the bugs, as you would in any other piece of code. Forcing your users to worry about mismatched KEY_DOWN and KEY_UP events, just because Windows does, is on the other hand quite negligent. I would advocate synthetic KEY_UP events on focus loss, perhaps optional but enabled by default, or perhaps flagged as synthetic inside the event object. Oh yeah, another thing that might be good if it&#39;s not currently possible - the ability to get the full keyboard state as it was at the time of the current event, as opposed to the latest possible state.)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Bruce Perry)</author>
		<pubDate>Mon, 25 Jun 2012 06:31:53 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thanks for your input, Bruce.  This thread needed it.</p><p>To be fair, this discussion started in <a href="http://www.allegro.cc/forums/thread/610492">another thread</a>, where I already have explained what &quot;extended&quot; keys are, probably more than once.  And I didn&#39;t start &quot;shouting&quot; until having posted the same information multiple times and having it seemingly ignored. I was hoping that underlining the main points would help. As for the Enter keys, I think he already knew that Allegro treated them as two different keys. I&#39;m posting this clarification in the hope that more people won&#39;t start to &quot;gang up on me&quot;.  Please treat this as a technical discussion, not a political one.</p><p>Dennis: If my suggested solution is not the right one, please explain the original issue.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (torhu)</author>
		<pubDate>Mon, 25 Jun 2012 06:55:09 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/610504/958494#target">Bruce Perry</a> said:</div><div class="quote"><p>When I go back to the game, I will happily release and re-press a key if I was holding it and it doesn&#39;t respond the first time. This is accepted behaviour, as is very rare anyway since the default physical state of a keyboard is &#39;all keys up&#39; anyway.</p></div></div><p>And you can do that yourself. I just don&#39;t think we should make it impossible to get correct keyboard state/events in the case of switch outs.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Mon, 25 Jun 2012 07:06:38 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/610504/958494#target">Bruce Perry</a> said:</div><div class="quote"><p> But it&#39;s possible that Windows will have set win_key_state[0x0D] if ALLEGRO_KEY_PAD_ENTER is held down. If so, then ALLEGRO_KEY_ENTER will be set incorrectly. Have you checked for this?</p></div></div><p>Here&#39;s how to reproduce this with the current code (using the patch from this thread):</p><p>1. Modify ex_keyboard_events to report the ALLEGRO_KEY_ENTER state. E.g. like this:
</p><div class="source-code snippet"><div class="inner"><pre><span class="k1">static</span> <span class="k1">void</span> log_key<span class="k2">(</span><span class="k1">char</span> <span class="k1">const</span> <span class="k3">*</span>how, <span class="k1">int</span> keycode, <span class="k1">int</span> unichar, <span class="k1">int</span> modifiers<span class="k2">)</span>
<span class="k2">{</span>
   <span class="k1">char</span> multibyte<span class="k2">[</span><span class="n">5</span><span class="k2">]</span> <span class="k3">=</span> <span class="k2">{</span><span class="n">0</span>, <span class="n">0</span>, <span class="n">0</span>, <span class="n">0</span>, <span class="n">0</span><span class="k2">}</span><span class="k2">;</span>
   <span class="k1">const</span> <span class="k1">char</span><span class="k3">*</span> key_name<span class="k2">;</span>
<div class="highlight">   <a href="http://www.allegro.cc/manual/ALLEGRO_KEYBOARD_STATE"><span class="a">ALLEGRO_KEYBOARD_STATE</span></a> s<span class="k2">;</span></div>

   <a href="http://www.allegro.cc/manual/al_utf8_encode"><span class="a">al_utf8_encode</span></a><span class="k2">(</span>multibyte, unichar <span class="k3">&lt;</span><span class="k3">=</span> <span class="n">32</span> ? <span class="s">' '</span> <span class="k2">:</span> unichar<span class="k2">)</span><span class="k2">;</span>
   key_name <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_keycode_to_name"><span class="a">al_keycode_to_name</span></a><span class="k2">(</span>keycode<span class="k2">)</span><span class="k2">;</span>
   log_printf<span class="k2">(</span><span class="s">"%-8s  code=%03d, char='%s' (%4d), modifiers=%08x, [%s]\n"</span>,
      how, keycode, multibyte, unichar, modifiers, key_name<span class="k2">)</span><span class="k2">;</span>
   
<div class="highlight">   <a href="http://www.allegro.cc/manual/al_get_keyboard_state"><span class="a">al_get_keyboard_state</span></a><span class="k2">(</span><span class="k3">&amp;</span>s<span class="k2">)</span><span class="k2">;</span></div>
<div class="highlight">   log_printf<span class="k2">(</span><span class="s">"Enter is pressed: %s\n"</span>, <a href="http://www.allegro.cc/manual/al_key_down"><span class="a">al_key_down</span></a><span class="k2">(</span><span class="k3">&amp;</span>s, ALLEGRO_KEY_ENTER<span class="k2">)</span> ? <span class="s">"yes"</span> <span class="k2">:</span> <span class="s">"no"</span><span class="k2">)</span><span class="k2">;</span></div>
<span class="k2">}</span>
</pre></div></div><p>
2. Run the example, highlight the log window and press and hold the numpad enter key<br />3. While holding the numpad enter key, switch to the main window<br />4. You&#39;ll note that Allegro is erroneously reporting the enter key is pressed<br />5. Release the numpad enter key and press some other keys (not the enter key though)<br />6. You&#39;ll note that the enter key is still reported as pressed
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SiegeLord)</author>
		<pubDate>Mon, 25 Jun 2012 07:11:54 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thanks, SiegeLord.  Let me note that this is just the tip of the iceberg, there are about 15 keys that are problematic.  The End key and the numpad End key is another example of keys that have this relationship.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (torhu)</author>
		<pubDate>Mon, 25 Jun 2012 07:20:37 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Ok, so to summarize my understanding:</p><ul><li><p>One minor problem in current SVN is that the .modifiers field of ALLEGRO_KEY_DOWN messages has wrong information (SHIFT appears pressed when it is not) when returning after a switch. The patch in this thread fixes that. Except for modifiers which are extended keys, I don&#39;t know whether any of them are - does anyone know?</p></li><li><p>al_get_keyboard_state() has stale information when returning after a switch. The patch fixes this, except for extended keys, as explained by entheh and as seen in SiegeLord&#39;s example. For those keys the behavior is the same as before the patch.</p></li></ul><p>

So, I&#39;d say the patch should be modified to not touch al_get_keyboard_state at all - only fix the event modifiers issue for now.</p><p>A separate patch may do something about al_get_keyboard_state afterwards, but according to torhu that may not be possible for extended keys.</p><p>(The event generation and switching behavior are separate issues but already work as intended anyway.)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Elias)</author>
		<pubDate>Mon, 25 Jun 2012 16:56:00 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;ll also try to summarize all the issues at hand again (even though this patch was never meant to fix ALL of them).</p><div class="source-code"><div class="toolbar"><span class="button numbers"><b>#</b></span><span class="button select">Select</span><span class="button expand">Expand</span></div><div class="inner"><span class="number">  1</span>without any patch
<span class="number">  2</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span>
<span class="number">  3</span>Window states
<span class="number">  4</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span>
<span class="number">  5</span>input focus                                 no input focus
<span class="number">  6</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span>
<span class="number">  7</span>Windows Events ok                           Windows Events are <span class="k1">not</span> generated, <span class="k1">not</span> evaluated
<span class="number">  8</span><a href="http://www.allegro.cc/manual/al_get_keyboard_state"><span class="a">al_get_keyboard_state</span></a> ok                    <a href="http://www.allegro.cc/manual/al_get_keyboard_state"><span class="a">al_get_keyboard_state</span></a> <span class="k1">not</span> ok <span class="k2">(</span>always holds last known state before losing focus<span class="k2">)</span>
<span class="number">  9</span><span class="k2">(</span>internal state is maintained by events<span class="k2">)</span>    <span class="k2">(</span>internal is maintained by Windows events, but they are none, so it never <a href="http://www.delorie.com/djgpp/doc/libc/libc_417.html" target="_blank">gets</a> updated<span class="k2">)</span>
<span class="number"> 10</span>
<span class="number"> 11</span>state switches
<span class="number"> 12</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span>
<span class="number"> 13</span>focus to no focus <span class="k3">-</span><span class="k3">&gt;</span> internal state is kept with last known information as it was continuously updated by evaluating events
<span class="number"> 14</span>no focus to focus <span class="k3">-</span><span class="k3">&gt;</span> internal state can hold wrong information about all sorts of keys <span class="k1">and</span> modifiers <span class="k2">(</span>SHIFT, ALT, CTRL, etc...<span class="k2">)</span>
<span class="number"> 15</span>                     <span class="k1">this</span> affects events as well, because the use the wrongly stored modifiers in their event data
<span class="number"> 16</span>
<span class="number"> 17</span>
<span class="number"> 18</span>with <span class="k1">this</span> patch
<span class="number"> 19</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span>
<span class="number"> 20</span>everything as aboves except one state <span class="k1">switch</span> difference:
<span class="number"> 21</span>no focus to focus <span class="k3">-</span><span class="k3">&gt;</span> an attempt is made to fix the internal state as good as technically possible <span class="k1">for</span> all keys which have a known
<span class="number"> 22</span>                     VK_ to ALLEGRO_KEY_ entry in the current mapping <span class="k1">and</span> to update the internal modifier state
<span class="number"> 23</span>                     <span class="k1">this</span> fixes the wrong modifier data in allegro event data fields
</div></div><p>

The misunderstanding here was that it was assumed that the patch in this thread was meant to fix more than the wrong modifiers for now.</p><p>It was repeatedly wrongly assumed that the patch was also meant to fix ALL the other issues from the old thread.</p><p>The other misunderstanding is that we have different opinions about how the application <b>should</b> behave and what key state changes and key events it <b>should</b> be aware of, depending on Window state.</p><p>The one camp want&#39;s to simply clear the whole internal state(this should include all key state also for modifiers) on switching out.</p><p>The other camp argues that the internal state and the event based approach should display consistent behavior and that since no key-up event is generated on switching away, the state should not get cleared either because that would be the equivalent to a key-up event.</p><p>Before further (correct by definition of what the system <b>should</b> do) patching to fix other issues can be made, we need to reach consensus on a few things:</p><p>1. Should usage of event based keyboard handling and state based keyboard handling be consistent?<br />1.a) yes<br />1.b) no</p><p>If 1.a) (keep consistency) then:<br />2.) How should consistency be achieved?<br />2.a) keep everything as it is: state will keep last known state before switching away (consistent with no extra events as they are currently not generated, so a program re-acting to just key-down will just as a state based program still think the key is being held)<br />2.b) clear state and generate (Allegro)key_up events for all keys being held while switching away<br />2.c) keep state and update state after switching in as good as possible (technically not possible for some keys, maybe possible but needs further investigation of the data returned by the Windows API calls) and generate key-down events for keys being held while switching in</p><p>If 1.b) (give up consistency) then:<br />3.) Should the state simply be cleared on...?<br />3.a) switching away<br />3.b) switching back in<br />3.c) switching away and switching back in</p><p>This patch could be best described as a part-solution on the way to achieve 1.a) with option 2.c).</p><p>Without using this patch and making a different patch, the technically easiest to achieve behavior would be 1.b) with 3.c).</p><p>Another technically possible behavior would be 1.a) in combination with 2.b) to get consistency for switching-away behavior.<br />That would not fix inconsistencies on switching in though except if in addition to 2.b), 2.c) would also be implemented.</p><p>So, in short, the most we could do would be 1.a) with 2.b) AND 2.c) in an attempt to keep consistency.<br />The easiest we could do is 1.b) with 3.c) while throwing consistency overboard.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dennis)</author>
		<pubDate>Mon, 25 Jun 2012 21:08:28 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;d say consistency between events and state is not important. Events should always correspond to WM_ messages 1:1, for keyboard as well as switch events. We do not and should not create any fake messages.</p><p>We do want correct .modifers fields for events though.</p><p>The state API has a different purpose, it&#39;s supposed to give a snapshot of all keyboard keys at the time you call the function. So there is no concept of consistency between the two APIs, they are not meant to be (but if the implementation makes them, it&#39;s not a problem).
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Elias)</author>
		<pubDate>Mon, 25 Jun 2012 21:45:38 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/610504/958550#target">Elias</a> said:</div><div class="quote"><p>We do not and should not create any fake messages.</p></div></div><p>Why not? We paper over issues in the underlying platforms all the time. This would just be another case of us working around an issue in the underlying platform.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Mon, 25 Jun 2012 21:47:55 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hm, maybe. We should first find agreement on applying a fix for the .modifers field though since that&#39;s all I&#39;m interested in <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Elias)</author>
		<pubDate>Mon, 25 Jun 2012 21:49:38 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/610504/958530#target">Elias</a> said:</div><div class="quote"><p> I don&#39;t know whether any of them are - does anyone know?
</p></div></div><p>There are these two (inside extkey_to_keycode).
</p><div class="source-code snippet"><div class="inner"><pre><span class="k1">case</span> VK_CONTROL:  <span class="k1">return</span> ALLEGRO_KEY_RCTRL<span class="k2">;</span>
<span class="k1">case</span> VK_MENU:     <span class="k1">return</span> ALLEGRO_KEY_ALTGR<span class="k2">;</span>
</pre></div></div><p>
Still, there are VK_RCONTROL and VK_RMENU too... I don&#39;t know if Windows gives you the correct data for those keycodes, or not.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p> For those keys the behavior is the same as before the patch.
</p></div></div><p>No, it&#39;s not. Before the patch you couldn&#39;t get numpad enter to cause enter to be pressed. This new behavior is not an omission of a fix, but an <i>introduced</i> bug. The only way to get this quoted statement to be true would be to ignore the keys that have extended key variants, which this patch does not do.</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/610504/958550#target">Elias</a> said:</div><div class="quote"><p> The state API has a different purpose, it&#39;s supposed to give a snapshot of all keyboard keys at the time you call the function.
</p></div></div><p>And on Windows the only way to guarantee this is to make it consistent with the WM_ messages, and thus consistent with Allegro events (not fake events though).</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/610504/958530#target">Elias</a> said:</div><div class="quote"><p> So, I&#39;d say the patch should be modified to not touch al_get_keyboard_state at all - only fix the event modifiers issue for now.</p></div></div><p>I think this is the best solution (/if/ it&#39;s even possible, given the beginning of my post) given the current understanding of what&#39;s possible under Windows. This decouples modifiers from al_get_keyboard_state (as they are already on Linux, for example) and keeps events consistent with the keyboard state.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SiegeLord)</author>
		<pubDate>Mon, 25 Jun 2012 23:26:59 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/610504/958561#target">SiegeLord</a> said:</div><div class="quote"><p> This new behavior is not an omission of a fix, but an introduced bug.</p></div></div><p>

In current SVN if you keep any key pressed while switching out, it will be reported as stuck. With the new version, only if you keep one of the extended keys presse it will still be reported as stuck. So the new version does not completely fix the problem, but certainly not introduce a new one. (Note that al_get_keyboard_state is not modified except for the re-sync on switch-in.)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Elias)</author>
		<pubDate>Mon, 25 Jun 2012 23:47:04 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/610504/958566#target">Elias</a> said:</div><div class="quote"><p> With the new version, only if you keep one of the extended keys presse it will still be reported as stuck.</p></div></div><p>No. You press the numpad enter and the regular enter key gets stuck. In my example you <i>never</i> press the regular enter key, and yet it&#39;s reported as pressed.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SiegeLord)</author>
		<pubDate>Mon, 25 Jun 2012 23:52:49 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>SiegeLord, you&#39;re right. It is an introduced bug due to the patch being incomplete and not fixing all the other issues yet.</p><p>Elias, I have attached a new patch<span class="ref"><sup>[<a href="#">1</a>]</sup></span> to this post which only attempts to read in the modifier flags and the toggle modifiers after a switch in, without attempting to get the states for all other keys. This fixes the wrong modifier flags in events.
</p><div class="ref-block"><h2>References</h2><ol><li><a href="http://www.allegro.cc/files/attachment/606198">http://www.allegro.cc/files/attachment/606198</a></li></ol></div></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dennis)</author>
		<pubDate>Tue, 26 Jun 2012 00:21:23 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Ok, now we have progress <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /></p><p>Is the _al_win_wnd_call_proc stuff needed?  I don&#39;t think so, but maybe you know something I don&#39;t.  Removing it would simplify a lot.</p><p>But what is your actual goal here?  It started out being only updating the modifier keys in the state returned by al_get_keyboard_state(). You wanted to get rid of stuck keys, I assumed.  The solution is simple, just clear the state on switch in, call update_toggle_modifiers().  This fixes the actual problem: stuck keys. Nobody will know the difference, and the code is simple.</p><p>But now the char event modifiers field has entered the picture.  The only reliable fix for that is to update the modifiers each time a char event is created in _al_win_kbd_handle_key_press().  GetKeyboardState is already being called there, since ToUnicode requires it.</p><p>If you want to fix both issues, just do both fixes.</p><p>There are some other things I should mention, but that can wait.</p><p>EDIT: Allright, I&#39;m working on a patch...</p><p>UPDATE: Patch attached, please comment. Needs some more testing, and I can probably combine update_toggle_modifiers and update_modifiers into a single function, etc.</p><p>It does basically two things:
</p><ol><li><p>On keyboard initialization and at switch in it clears the keyboard state, <s>but updates the toggle keys so that they match the lights on your keyboard</s>. No stuck keys, but no <s>complete</s> keyboard state update either.
</p></li><li><p>ALLEGRO_EVENT_KEY_CHAR&#39;s modifiers field is completely updated every time a char event is sent.  This should be 100% reliable, but more testing still needed.</p></li></ol><p>A question: the mouse grab key stuff.  Is that still supported?  Currently my patch breaks that.</p><p>UPDATE2: Just realized, one part of the patch is bogus <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (torhu)</author>
		<pubDate>Tue, 26 Jun 2012 07:27:43 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I don&#39;t think we should patch anything other than the incorrect modifier flags in the events until there is consensus about the behavior options I described above in the second half of my longest post.</p><p>We should have consistency across different systems. How is switching out/switching in handled on other platforms with regard to the keyboard state?</p><p>(and by keyboard state I mean everything: key states, modifier states, toggle key states)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dennis)</author>
		<pubDate>Tue, 26 Jun 2012 17:18:37 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Yeah, does anyone feel like running ex_keyboard_events on Linux and OS X and tell us if you get key up events on switch in or switch out?  Other platforms could be interesting too.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (torhu)</author>
		<pubDate>Wed, 27 Jun 2012 09:26:56 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You only get keyboard events when you have focus in X11.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Elias)</author>
		<pubDate>Wed, 27 Jun 2012 14:39:20 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/610504/958775#target">Elias</a> said:</div><div class="quote"><p>You only get keyboard events when you have focus in X11.</p></div></div><p>
Ok and what about the al_get_keyboard_state() function?<br />Does that still report keys as pressed which were held down while losing focus while you do not have focus?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dennis)</author>
		<pubDate>Thu, 28 Jun 2012 17:39:26 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Looks like nobody cares enough to bother testing.  Attached is a simpler patch that just clears the state and the modifiers on switch in.  And it doesn&#39;t break the mouse grab keys or anything else.</p><p>After the information that there are no &quot;fake&quot; events on Linux, this is how I see the relationship between state and events: If you use events for keyboard input in your game, you have to assume that anything can happen while your game does not have input focus, and you have to deal with that.  But if you use al_get_keyboard_state, it&#39;s reasonable to expect an updated state each time you call the function.</p><p>With this patch, al_get_keyboard_state will much less frequently report keys that are up as being down.  You can still trick it if you really want to.  Anyway, I feel that reporting keys that are down as being up is less of a problem that the other way around, which is what we have now.</p><p>Discuss <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (torhu)</author>
		<pubDate>Sat, 30 Jun 2012 11:56:58 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Dude it&#39;s been two days.</p><p>That said I really don&#39;t care about the state api. IMO it&#39;s a crutch. To me, its like someone setting up a bitmap to do double buffering in A5 the way they did in A4.</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/610504/959109#target">torhu</a> said:</div><div class="quote"><p> But if you use al_get_keyboard_state, it&#39;s reasonable to expect an updated state each time you call the function.</p></div></div><p>Why is it reasonable to asume that the state api doesn&#39;t give you incorrect info if the events do?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Sat, 30 Jun 2012 13:52:47 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/610504/959109#target">torhu</a> said:</div><div class="quote"><p> But if you use al_get_keyboard_state, it&#39;s reasonable to expect an updated state each time you call the function.
</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/610504/959110#target">Thomas Fjellstrom</a> said:</div><div class="quote"><p> Why is it reasonable to asume that the state api doesn&#39;t give you incorrect info if the events do?
</p></div></div></div></div><p>Well, the docs for <span class="source-code"><a href="http://www.allegro.cc/manual/al_get_keyboard_state"><span class="a">al_get_keyboard_state</span></a></span> do say &quot;at the time the function is called&quot;.</p><p>I used to use al_get_keyboard_state in one of my projects. But switched to maintaining my own state based on events, to avoid the occasional stuck keys on switch ins.  The problem is you don&#39;t know if the state Allegro gives you might have been messed up by a switch out while keys were held down or not.  And a stuck key is stuck until you happen to press it again, it doesn&#39;t go away by itself.</p><p>By the way, I had a look at the X and the OS X keyboard code, and I couldn&#39;t find any clearing of the state at switch in or switch out there.  So now we know.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (torhu)</author>
		<pubDate>Sat, 30 Jun 2012 16:21:33 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/610504/959112#target">torhu</a> said:</div><div class="quote"><p>By the way, I had a look at the X and the OS X keyboard code, and I couldn&#39;t find any clearing of the state at switch in or switch out there. So now we know.</p></div></div><p>Ok, so all we should do is fix the modifier flags for now without touching anything else. ( this patch does that: <a href="http://www.allegro.cc/files/attachment/606198">http://www.allegro.cc/files/attachment/606198</a> )<br />([edit] To clarify: If on other platforms the state is never cleared, neither should the Windows implementation do so. [/edit])</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>Well, the docs for al_get_keyboard_state do say &quot;at the time the function is called&quot;.</p></div></div><p>That&#39;s technically impossible in Windows if it is called while the window does not have input focus (But we already knew that, which is why we starting having this discussion about clearing it in the first place to prevent stuck keys.)</p><p>So... what are we to do:<br />A reasonable thing to do is, leave everything as is (except for patching the modifier problem) and add a user level function &#39;al_clear_keyboard_state&#39; which users can call themselves to achieve any key state behavior they consider most suitable for their application.<br />If they don&#39;t call that function on switch-out, al_get_keyboard_state, will continue to report keys which were pressed while switching away (consistent with never receiving a key-up event).
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dennis)</author>
		<pubDate>Sat, 30 Jun 2012 17:10:12 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Tomasu, keyboard state is a very useful thing - I don&#39;t think it&#39;s reasonable to view it as a crutch.</p><p>On the other hand, I would be in favour of being able to get the state <i>at the time of the event most recently pulled from the queue</i>, as opposed to the most up-to-date state at the time of the call. That way you could mix the two mechanisms perfectly. Especially if you&#39;re using timer events to drive your main loop.</p><p>[APPEND]
</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/610504/959109#target">torhu</a> said:</div><div class="quote"><p>Attached is a simpler patch that just clears the state and the modifiers on switch in.</p></div></div><p>
Why don&#39;t you clear them on switch-out?</p><p>If something steals focus while you&#39;re scrolling a map, and that map continues scrolling, that&#39;s extremely stressful. No one will ever want keys reported held while there&#39;s no focus. Holding a key down is an active behaviour. No one wants that if they&#39;re not looking at the window right now. Ever.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Bruce Perry)</author>
		<pubDate>Sat, 30 Jun 2012 17:11:52 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/610504/959115#target">Bruce Perry</a> said:</div><div class="quote"><p>On the other hand, I would be in favour of being able to get the state at the time of the event most recently pulled from the queue, as opposed to the most up-to-date state at the time of the call.</p></div></div><p>

That&#39;s very easy to do already (it&#39;s exactly how my wrapper works). And it never was the idea of the state API. I&#39;d completely agree to having it work like that (or dropping it completely, as I often said on the mailing list in the past) though <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /></p><p>But the state API as it is now is for when you want imprecise input like in A4 or for the rare cases where the events API does not work - right at startup, and after a switch-in - since you could not have got a key down event for keys pressed while the application was not running. (It seems this very use-case is broken in the Windows implementation though.)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Elias)</author>
		<pubDate>Sat, 30 Jun 2012 17:19:34 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/610504/959115#target">Bruce Perry</a> said:</div><div class="quote"><p> Why don&#39;t you clear them on switch-out?
</p></div></div><p>Yes, that&#39;s probably better.</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/610504/959114#target">Dennis</a> said:</div><div class="quote"><p> Ok, so all we should do is fix the modifier flags for now without touching anything else. ( this patch does that: <a href="http://www.allegro.cc/files/attachment/606198">http://www.allegro.cc/files/attachment/606198</a> )
</p></div></div><p>Well, I guess it&#39;s better than nothing.  I still think just clearing them on switch in would fix the problem, though.</p><p>I have some comments on the patch in any case:
</p><ol><li><p>Is the _al_win_wnd_call_proc stuff needed?  I don&#39;t think so, but maybe you know something I don&#39;t.  What does it achieve?
</p></li><li><p>If you don&#39;t use _al_win_wnd_call_proc, there&#39;s no point in finding the foreground window etc.
</p></li><li><p>You could just call GetKeyState for the keys you care about, instead of GetKeyboardState. No big deal, though.
</p></li><li><p>init_keyboard() doesn&#39;t update the modifiers, should it?
</p></li><li><p>The call to update_toggle_modifiers is not needed, as it&#39;s called in _al_win_kbd_handle_key_press every time a char event is created.
</p></li><li><p>You forgot VK_APPS (ALLEGRO_KEY_MENU)
</p></li></ol></div>]]>
		</description>
		<author>no-reply@allegro.cc (torhu)</author>
		<pubDate>Sat, 30 Jun 2012 19:02:52 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You&#39;re right. I left most of the stuff in in preparation for a future attempt at fixing the other problems but since that&#39;s not possible, none of that is needed anymore and just clearing the modifier state is sufficient.</p><p>Have a look at this minimal modifier state patch then <span class="ref"><sup>[<a href="#">1</a>]</sup></span>.
</p><div class="ref-block"><h2>References</h2><ol><li><a href="http://www.allegro.cc/files/attachment/606221">http://www.allegro.cc/files/attachment/606221</a></li></ol></div></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dennis)</author>
		<pubDate>Sat, 30 Jun 2012 19:39:15 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The patch looks fine as far as I&#39;m concerned.</p><p>al_install_keyboard() is supposed to support being called multiple times, and I assume it&#39;s supposed to be threadsafe, but that&#39;s for another day <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (torhu)</author>
		<pubDate>Sat, 30 Jun 2012 20:11:44 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/610504/959130#target">torhu</a> said:</div><div class="quote"><p>The patch looks fine as far as I&#39;m concerned.</p></div></div><p>I have submitted that patch to the mailing list (in GIT format for the current 5.1 branch from the recently set up new GIT repository).
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dennis)</author>
		<pubDate>Wed, 04 Jul 2012 15:42:00 +0000</pubDate>
	</item>
</rss>
