<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Learning the World &#187; keyboard access</title>
	<atom:link href="http://learningtheworld.eu/tag/keyboard-access/feed/" rel="self" type="application/rss+xml" />
	<link>http://learningtheworld.eu</link>
	<description></description>
	<lastBuildDate>Tue, 06 Nov 2012 00:17:33 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.9.1</generator>
	<item>
		<title>Enhanced Keyboard-accessible Google Maps</title>
		<link>http://learningtheworld.eu/2009/keyboard-accessible-google-maps/</link>
		<comments>http://learningtheworld.eu/2009/keyboard-accessible-google-maps/#comments</comments>
		<pubDate>Tue, 28 Apr 2009 19:00:28 +0000</pubDate>
		<dc:creator><![CDATA[Martin Kliehm]]></dc:creator>
				<category><![CDATA[accessibility]]></category>
		<category><![CDATA[downloads]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[hCard]]></category>
		<category><![CDATA[keyboard access]]></category>
		<category><![CDATA[microformats]]></category>
		<category><![CDATA[opera]]></category>
		<category><![CDATA[Patrick H. Lauke]]></category>
		<category><![CDATA[vcard]]></category>

		<guid isPermaLink="false">http://learningtheworld.eu/?p=517</guid>
		<description><![CDATA[<strong>Patrick H. Lauke</strong> wrote an excellent article about <strong>keyboard-accessible Google Maps</strong> on the Opera Developer website. Still I was able to improve it slightly when I implemented an accessible map myself. I would like to share these modifications with you.]]></description>
				<content:encoded><![CDATA[<p><a href="http://twitter.com/patrick_h_lauke">Patrick H. Lauke</a> wrote an excellent article about <a href="http://dev.opera.com/articles/view/keyboard-accessible-google-maps/">keyboard-accessible Google Maps</a> on the Opera Developer website. Still I was able to improve it slightly when I implemented an <a href="http://eafra.eu/2009/venue/">accessible map</a> myself. I would like to share these modifications with you:</p>

<ul>
<li>A <strong>link to Google Maps</strong> when JavaScript is disabled.</li>
<li>Support for the <strong><a href="http://code.google.com/apis/ajax/documentation/">Google <acronym title="Asynchronous JavaScript and XML">AJAX</acronym> <acronym title="Application Programming Interface">API</acronym> Loader</a></strong>.</li><li>Using the <strong>small map control</strong>.</li>
<li>Keyboard accessibility for <strong><em>all</em> control elements</strong> within the map.</li>
</ul>

<p>As a fallback without JavaScript&nbsp;&mdash; because people disable it, because their mobile device doesn&rsquo;t support it, or because it gets filtered by corporate proxies&nbsp;&mdash; Patrick used the little known <a href="http://code.google.com/intl/en-US/apis/maps/documentation/staticmaps/">Google Static Maps <acronym>API</acronym></a>, but for some reason he missed adding the link to Google. Here is the fix:</p>

<ol class="code" title="HTML code">
<li><code>&lt;div id=&quot;map&quot;&gt;</code></li>
<li class="indent"><code><strong>&lt;a href=&quot;http://maps.google.com/maps<span class="codeSpace">&nbsp;</span><span class="nowrap">?f=q&amp;amp;output=html</span><span class="codeSpace">&nbsp;</span><span class="nowrap">&amp;amp;q=50.110950+8.684666&quot;</span> title=&quot;Google Maps&quot;&gt;</strong></code></li>
<li class="double">&lt;img src=&quot;http://maps.google.com/staticmap?hl=en<span class="codeSpace">&nbsp;</span><span class="nowrap">&amp;amp;center=50.112267,8.678384</span><span class="codeSpace">&nbsp;</span><span class="nowrap">&amp;amp;markers=50.110950,8.684666,red</span><span class="codeSpace">&nbsp;</span><span class="nowrap">&amp;amp;zoom=15&amp;amp;size=500&#x78;300</span><span class="codeSpace">&nbsp;</span><span class="nowrap">&amp;amp;key=[Your API Key]&quot;</span> alt=&quot;City map of Frankfurt&quot; width=&quot;500&quot; height=&quot;300&quot; /&gt;</li>
<li class="indent"><code><strong>&lt;/a&gt;</strong></code></li>
<li><code>&lt;/div&gt;</code></li>
</ol>

<div>
<p><a href="http://maps.google.com/maps?f=q&amp;output=html&amp;q=50.110950757575814+8.684666901826859" title="Google Maps" id="maps-static-without-js"><img src="http://maps.google.com/staticmap?hl=de&amp;center=50.112267,8.678384&amp;markers=50.110950757575814,8.684666901826859,red&amp;zoom=15&amp;size=500x300&amp;key=ABQIAAAAiX9IUvugciHL2lvi9eAyFBSMjuiRZEUjgLWr4CdH8vZ2LQfPbhTYj1_FZwtIQquykkDMnYbZpMJHXQ" alt="City Map of Frankfurt" width="510" height="300" /></a></p>
</div>

<p>Then I changed how the map is embedded. As it seems that the <a href="http://code.google.com/apis/ajax/documentation/"><acronym>API</acronym> loader</a> is more current, I preferred that way:</p>

<ol class="code" title="HTML code">
<li><code>&lt;script type=&quot;text/javascript&quot; src=&quot;http://www.google.com/jsapi?key=[Your API Key]&quot;&gt;&lt;/script&gt;</code></li>
<li><code>&lt;script type=&quot;text/javascript&quot; src="/js/accgmap.js&quot;&gt;&lt;/script&gt;</code></li>
<li><code>&lt;script type=&quot;text/javascript&quot;&gt;</code></li>
<li class="indent"><code>google.load( &#x27;maps&#x27;, &#x27;2&#x27;, { &#x27;language&#x27; : &#x27;en&#x27; } );</code></li>
<li class="indent"><code>google.setOnLoadCallback( GMAP.initMap );</code></li>
<li><code>&lt;/script&gt;</code></li>
</ol>

<p>Using the small control elements is trivial: <code>SmallMapControl()</code>. The next thing I wanted to change was <strong>keyboard access to <em>all</em> controls</strong>, in particular for the map type, <abbr title="that is">i.e.</abbr> <code>Map&nbsp;| Satellite&nbsp;| Hybrid</code>. Patrick refers to an <code>id</code>, but I found that all relevant controls have a <code>title</code>, so I just checked for that attribute. I also dropped setting the <code>style</code> attribute in JavaScript as that belongs in the <acronym title="Cascading Style Sheets">CSS</acronym> file. His original function <code>GKeyboardPatch()</code> now looks like this (note the <code>while</code> loop for a slightly better performance):</p>

<ol class="code" title="JavaScript code">
<li><code>GKeyboardPatch: <strong>function</strong>( map ) {</code></li>
<li class="indent"><code>var</code> button, divs = map.getContainer().getElementsByTagName( &#x27;div&#x27; );</li>
<li class="indent"><code>var</code> i = 0;</li>
<li class="indent"><code>while</code> ( divs[i] ) {</li>
<li class="double"><code>if ( divs[i].getAttribute( &#x27;log&#x27; ) || ( <em>divs[i].getAttribute( &#x27;title&#x27; ) &amp;&amp; divs[i].getAttribute( &#x27;title&#x27; ) != &#x27;&#x27;</em> ) ) {</code></li>
<li class="double"><span class="indent">button = document.createElement( &#x27;button&#x27; );</span></li>
<li class="double"><span class="indent">button.setAttribute( &#x27;value&#x27;, divs[i].getAttribute( &#x27;title&#x27; ));</span></li>
<li class="double"><span class="indent">divs[i].appendChild( button );</span></li>
<li class="double"><span class="indent">if ( divs[i].getAttribute( &#x27;log&#x27; )) { <code>// only control buttons</code></span></li>
<li class="double"><code class="double">// override the IE opacity filter that Google annoyingly sets</code></li>
<li class="double"><span class="double">divs[i].style.filter = &#x27;&#x27;;</span></li>
<li class="double"><code class="double">// should really set to &#x27;transparent&#x27;</code></li>
<li class="double"><span class="double">divs[i].style.background = <span class="nowrap">&#x27;url( http://www.google.com/</span><span class="codeSpace">&nbsp;</span>intl/en_ALL/mapfiles/transparent.png )&#x27;;</span></li>
<li class="double"><span class="indent">}</span></li>
<li class="double">}</li>
<li class="double">i++;</li>
<li class="indent">}</li>
<li>}</li>
</ol>

<p>Now remember I said I&rsquo;d rather separate style and behaviour, so here are a some lines of <acronym>CSS</acronym> with the setting of <code>width</code> and <code>height</code> for the <code>#map</code> being most relevant, otherwise it will collapse:</p>

<ol class="code" title="CSS code">
<li><code>#map {</code></li>
<li class="indent">height: 300px;</li>
<li class="indent">overflow: hidden;</li>
<li class="indent">position: relative;</li>
<li class="indent">width: 500px;</li>
<li><code>}</code></li>
<li><code>#maps-static, #maps-static img {</code></li>
<li class="indent">display: block;</li>
<li><code>}</code></li>
<li><code>#map span.note {</code></li>
<li class="indent">display: none;</li>
<li><code>}</code></li>
<li><code>#map button {</code></li>
<li class="indent">background: transparent;</li>
<li class="indent">border-style: solid;</li>
<li class="indent">border-width: 0;</li>
<li class="indent">cursor: pointer;</li>
<li class="indent">height: 100%;</li>
<li class="indent">left: -2px;</li>
<li class="indent">margin: 2px;</li>
<li class="indent">overflow: hidden;</li>
<li class="indent">padding: 2px;</li>
<li class="indent">position: absolute;</li>
<li class="indent">text-indent: -100em;</li>
<li class="indent">top: -2px;</li>
<li class="indent">width: 100%;</li>
<li><code>}</code></li>
<li><code>#map a:focus, #map a:active, #map button:focus, #map button:active {</code></li>
<li class="indent">outline: 2px dashed #61bf1a;</li>
<li><code>}</code></li>
</ol>

<p>And that&rsquo;s it, thanks again to Patrick for the solid foundation I built upon. Now <a href="/examples/js/accgmap.js">download the JavaScript code</a> and try to tab through the map below.</p>

<p>Actually on the other website I extracted <strong>hCard microformats</strong> from the page as well and displayed the addresses on the map, but I was lazy and used jQuery. I thought it doesn&rsquo;t look well here mixed with Patrick&rsquo;s clean <acronym title="Document Object Model">DOM</acronym> scripting, but feel free to <a href="http://eafra.eu/2009/venue/">take it from the original website</a>.</p>

<div id="map">
<p><a href="http://maps.google.com/maps?f=q&amp;output=html&amp;q=50.110950757575814+8.684666901826859" title="Google Maps" id="maps-static"><img src="http://maps.google.com/staticmap?hl=de&amp;center=50.112267,8.678384&amp;markers=50.110950757575814,8.684666901826859,red&amp;zoom=15&amp;size=500x300&amp;key=ABQIAAAAiX9IUvugciHL2lvi9eAyFBSMjuiRZEUjgLWr4CdH8vZ2LQfPbhTYj1_FZwtIQquykkDMnYbZpMJHXQ" alt="City Map of Frankfurt" width="510" height="300" /></a></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://learningtheworld.eu/2009/keyboard-accessible-google-maps/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Accessible Drop-Down Menus</title>
		<link>http://learningtheworld.eu/2008/accessible-drop-down-menus/</link>
		<comments>http://learningtheworld.eu/2008/accessible-drop-down-menus/#comments</comments>
		<pubDate>Mon, 11 Aug 2008 08:00:09 +0000</pubDate>
		<dc:creator><![CDATA[Martin Kliehm]]></dc:creator>
				<category><![CDATA[accessibility]]></category>
		<category><![CDATA[usability]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[ageing]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[aria]]></category>
		<category><![CDATA[arrow keys]]></category>
		<category><![CDATA[assistive technologies]]></category>
		<category><![CDATA[AT]]></category>
		<category><![CDATA[best practices]]></category>
		<category><![CDATA[blur]]></category>
		<category><![CDATA[buffer]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[DHTML]]></category>
		<category><![CDATA[drop-down]]></category>
		<category><![CDATA[event]]></category>
		<category><![CDATA[event delegation]]></category>
		<category><![CDATA[fly-out]]></category>
		<category><![CDATA[focus]]></category>
		<category><![CDATA[Hick's Law]]></category>
		<category><![CDATA[i18n]]></category>
		<category><![CDATA[image replacement]]></category>
		<category><![CDATA[internationalization]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[keyboard access]]></category>
		<category><![CDATA[menu]]></category>
		<category><![CDATA[menulist]]></category>
		<category><![CDATA[multi-level menus]]></category>
		<category><![CDATA[navigation]]></category>
		<category><![CDATA[pull-down]]></category>
		<category><![CDATA[role]]></category>
		<category><![CDATA[scalability]]></category>
		<category><![CDATA[screen reader]]></category>
		<category><![CDATA[screenreader]]></category>
		<category><![CDATA[sIFR]]></category>
		<category><![CDATA[tab order]]></category>
		<category><![CDATA[text resize]]></category>
		<category><![CDATA[WCAG]]></category>
		<category><![CDATA[web 2.0]]></category>

		<guid isPermaLink="false">http://learningtheworld.eu/?p=171</guid>
		<description><![CDATA[A few days ago a co-worker asked if <strong><acronym title="Dynamic HTML">DHTML</acronym> drop-down menus pose a problem with accessibility</strong>. Since the Web Content Accessibility Guidelines 1.0 (<acronym>WCAG</acronym>) declared all JavaScript <em>evil</em> in 1999, assistive technologies (<acronym>AT</acronym>) have made significant progress. So we cannot condemn pull-down menus altogether, but there are various reasons to keep an eye on them buggers.&#160;[&#8230;]]]></description>
				<content:encoded><![CDATA[<p>A few days ago a co-worker asked if <strong><acronym title="Dynamic HTML">DHTML</acronym> drop-down menus pose a problem with accessibility</strong>. Since the Web Content Accessibility Guidelines 1.0 (<acronym>WCAG</acronym>) declared all JavaScript <em>evil</em> in 1999, assistive technologies (<acronym>AT</acronym>) have made significant progress. So we cannot condemn pull-down menus altogether, but there are various reasons to keep an eye on them buggers:</p>

<ol>
<li id="ageing"><p><strong>Older people</strong> have difficulties with drop-down and <a href="http://www.w3.org/TR/wai-age-literature/">multi-level menus</a>, because their manual dexterity, eye-hand coordination and space perception decreases. Also some move the mouse when clicking, or tremble, hence it&#8217;s more likely they slip off the menu. Hell, that happens to <em>me</em> frequently!</p>
<p>However, did you notice the Windows Start Menu is more forgiving when you slip off an item? There&#8217;s a little delay before the secondary level is hidden. Perhaps we need an event-capturing script tolerating a slip from the menu rather than the immediate reaction of the <code>mouseout</code> event.</p></li>
<li id="hicks-law"><p>Nested menus are <strong>more complex</strong>. According to <a href="http://en.wikipedia.org/wiki/Hick%27s_law">Hick&#8217;s Law</a> orientation in a multi-level menu can take longer than multiple clicks in a flat menu with good information architecture. See an <a href="http://learningtheworld.eu/2007/usability-analysis/#hicks-law">earlier article</a> for the math.</p></li>
<li id="keyboard-access"><p>The navigation must be <strong>accessible by keyboard alone</strong>. The result should be the same, whether you hover over an item or tab to it. So check for the <code>focus</code> event and <acronym title="Cascading Style Sheets">CSS</acronym> pseudo-class. Don&#8217;t forget to test backwards tabbing (<kbd>shift tab</kbd>). By the way, mobile devices have no mouse either&hellip;</p>
<p>The <strong>tab order</strong> should be consistent and logical, <abbr>i.e.</abbr> not jumping around on a page. Also the focused item should be visible, for example highlighted with the default 1px dotted border some browsers draw around it. Some people think this is ugly and remove the default border. That is a no-no.</p>
<p>And if you <em>really</em> want desktop behavior, add support for the <strong>arrow keys</strong> (<code>event.keyCode</code> 37-40). Keep in mind though that screen readers have predefined functions for the arrow keys in combination with the <kbd>ctrl</kbd>, <kbd>shift</kbd>, or <kbd>alt</kbd> keys. In JavaScript those keys can be detected with the <code>event.ctrlKey</code>, <code>event.altKey</code>, and <code>event.shiftKey</code> properties. Also <strong>crossbrowser event delegation</strong> for <code>focus</code> or <code>blur</code> events can be a bitch, thankfully <a href="http://www.quirksmode.org/blog/archives/2008/04/delegating_the.html"><acronym title="Peter-Paul Koch">PPK</acronym> has a solution</a>.</p></li>
<li id="skip-content"><p>Users of <acronym>AT</acronym> should have means to <strong>skip content</strong>. That&#8217;s possible with semantic markup: a menu as (nested) list(s) enables them to jump to the next block. Also there should be <em>a few</em> skip links at the beginning of the code pointing to important sections on the page, such as content, navigation, or search. Mobile users also profit from that technique (try surfing eBay with Opera Mini <img src="http://learningtheworld.eu/wp-includes/images/smilies/icon_wink.gif" alt=";)" class="wp-smiley" />  ).</p></li>
<li id="links"><p><strong>Pages never link to themselves.</strong> When I click on a link (the menu being no exception) I expect to land on a <em>different</em> page. Therefore it&#8217;s confusing to land on the same page. This happened to me recently when I was filling out a form on my mobile phone and got the same page with an error message. It took me a while to realize where I was. It&#8217;s the same whether you have a tiny screen or a low screen resolution to see things larger when you are visually impaired: you only see a small part of the page, so it&#8217;s hard to realize when something unexpected happens.</p></li>
<li id="aria"><p>You can add some semantic sugar with the <strong><acronym title="Accessible Rich Internet Applications">ARIA</acronym> <code>role</code></strong> property. In this case <code>&lt;ul role=&quot;navigation&quot;&gt;</code> would be appropriate. I strongly encourage you to use <acronym>ARIA</acronym> as it is widely supported by browsers and screen readers, enhances a disabled user&#8217;s experience, and doesn&#8217;t break old browsers. A most <a href="http://dev.opera.com/articles/view/introduction-to-wai-aria/">recent introduction</a> has been written by Gez Lemon for the Opera Developer Community.</p></li>
<li id="buffer"><p>If a second level navigation is initially hidden with <code>display:none</code> it won&#8217;t be in the <strong>screen reader buffer</strong>. Therefore off-screen positioning is a better idea, else you need to <a href="http://juicystudio.com/article/improving-ajax-applications-for-jaws-users.php">update the buffer</a> by writing random values into a hidden <code>input</code> field.</p></li>
<li id="scaling"><p>A common problem in menus is <strong>limited horizontal space</strong>. Text should be scalable, and it must not jut-out into other page elements when it is <strong>enlarged</strong>. Even normal text can break a narrow menu when you think of internationalization. In German there are many composite words. While building a website for a competing brand I came across a menu item on the Philips website for &ldquo;male grooming.&rdquo; The German word &bdquo;<span xml:lang="de" lang="de">Körperhaarpflegesystem</span>&rdquo; is guaranteed to blow every menu! <img src="http://learningtheworld.eu/wp-includes/images/smilies/icon_smile.gif" alt=":)" class="wp-smiley" /> </p>
<p>Another common problem that prevents scaling in menus are <strong>text graphics</strong>. I know marketing just <em>loves</em> to see the corporate font in the main menu, but text in images can&#8217;t be scaled, people with visual impairments can&#8217;t change text and background colors for higher contrast, and <strong>Flash Image Replacement</strong> like sIFR still has <a href="http://virtuelvis.com/archives/2005/04/i-hate-sifr">accessibility issues</a>, is known to <a href="http://www.456bereastreet.com/archive/200712/choose_an_accessible_image_replacement_method/#comment26">distort fonts</a>, is <a href="http://www.mezzoblue.com/archives/2004/10/26/sifr/">CPU intensive and slow</a>. The bottom line is: don&#8217;t use text as images, make textual information text.</p></li>
</ol>

<p id="technical-issues">So much for accessibility. Besides there are a few <strong>technical issues</strong> to consider: mobile devices often have problems with JavaScript or with layers. Some proxies in large companies <a href="http://www.robertnyman.com/2006/04/25/an-important-lesson-learned-about-ajax-and-accessibility/">filter JavaScript</a> for security reasons, so you can&#8217;t rely on the ubiquitous availability, your script has to be unobtrusive, and you can&#8217;t rely on <code>noscript</code> either. Don&#8217;t even think of creating a menu from JavaScript arrays.</p>

<p>Moreover there&#8217;s a well-known bug in <acronym title="Internet Explorer">IE</acronym>6 responsible for showing <code>select</code> lists always in front of any layers (like your second level menu), regardless of a <code>z-index</code>. Thankfully there are plugins like <a href="http://brandonaaron.net/docs/bgiframe/">bgiframe</a> for jQuery to solve this. Multi-level menus can bloat the code, event handling can be CPU intensive (use <a href="http://icant.co.uk/sandbox/eventdelegation/">event delegation</a>). And if large amounts of menu code is at the beginning, the real content gets further behind and less relevant for search engines.</p>

<p>In <strong>conclusion</strong>, for an alleged quicker entry you pay with many disadvantages. Often drop-down menus just conceal a poorly planned information architecture. I would reconsider their usage.</p>

<p>Did I forget something? What&#8217;s your opinion on drop-down menus? Love them or hate them?</p>
]]></content:encoded>
			<wfw:commentRss>http://learningtheworld.eu/2008/accessible-drop-down-menus/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
