<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>[Linux] Does Allegro 5 respect xkb/xmodmap remapping?</title>
		<link>http://www.allegro.cc/forums/view/616770</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Thu, 02 Mar 2017 23:32:24 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I was trying to help another user with keyboard issues (trying being a keyword <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" /> ) and I noticed an oddity.</p><p>From the other thread, I was running the al_keyboard_event example. On my machine, I use xmodmap:</p><div class="source-code snippet"><div class="inner"><pre>xmodmap <span class="k3">-</span>e <span class="s">"keycode 22 = BackSpace Delete"</span>
</pre></div></div><p>

...so that my keyboard (which has no delete key) binds SHIFT+Backspace to be delete.</p><p>It works in Chrome and all other applications I normally use.</p><p>However, it does not work with al_keyboard_event. It simply shows backspace. (The actual key pressed, as opposed to the mapping.)</p><p>Now, I&#39;m not 100% sure where the distinction between xmodmap (&quot;depreciated&quot; in newest Ubuntu but still works) and xkb are. Perhaps a xkb remapping works fine with Allegro. I used xmodmap because it&#39;s simple (and downright better), while hacking xkb scripts is a super easy way to brick your machine. (Any syntax error end up with <i>no keyboard support at all</i>.)</p><p>I&#39;m not sure what the best, &quot;correct&quot; default behavior should be for Allegro, and whether there should be a configuration option. But it seems like Allegro should be respecting remapped keys for disabled people / international people.</p><p>Running Ubuntu 16.04 LTS with Allegro 5.1.11.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Chris Katko)</author>
		<pubDate>Sun, 26 Feb 2017 23:29:36 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The intention of ALLEGRO_KEY_CODE is to be just an opaque identifier of the key that is pressed. As it is implemented right now, on OSX and Windows key down/up events do not respect the keyboard layout, while on Linux they sometimes respect it and sometimes don&#39;t. I&#39;m working on code to opt into Linux never respecting the key layouts so you can rely on them being the same physical key cross-platform.</p><p>What does respect they key layout are the ALLEGRO_KEY_CHAR events and <span class="source-code"><a href="http://www.allegro.cc/manual/al_keycode_to_name"><span class="a">al_keycode_to_name</span></a></span>. The former allows you to handle text input, and the latter lets you convert the keycodes to something you can draw on the screen (which will respect the layout). I do note that <span class="source-code"><a href="http://www.allegro.cc/manual/al_keycode_to_name"><span class="a">al_keycode_to_name</span></a></span> doesn&#39;t seem to do what I&#39;m describing on Windows and it only sort of works on Linux like that... not sure about OSX.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SiegeLord)</author>
		<pubDate>Mon, 27 Feb 2017 00:24:25 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>It think it does respect the keyboard layout on Windows though. Might have to revert to using scan codes directly to avoid that...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (torhu)</author>
		<pubDate>Mon, 27 Feb 2017 11:51:45 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Allegro, Virtualbox, and SDL:  These three have never respected xmodmap for me.</p><p><a href="https://www.virtualbox.org/ticket/13404">Virtualbox did respect xmodmap at one point,</a> but one of the maintainers decided he did not like that.  I hope to one day map my keycodes in hardware.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Gideon Weems)</author>
		<pubDate>Thu, 02 Mar 2017 15:14: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/616770/1028747#target">Gideon Weems</a> said:</div><div class="quote"><p>
 but one of the maintainers decided he did not like that. 
</p></div></div><p>
Man, people really love to crap on the disabled. <img src="http://www.allegro.cc/forums/smileys/angry.gif" alt="&gt;:(" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Chris Katko)</author>
		<pubDate>Thu, 02 Mar 2017 23:32:24 +0000</pubDate>
	</item>
</rss>
