<?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>blog.i18n.ro &#187; keyboard</title>
	<atom:link href="http://blog.i18n.ro/tag/keyboard/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.i18n.ro</link>
	<description>Sorin&#039;s personal blog and website</description>
	<lastBuildDate>Fri, 06 Jan 2012 18:05:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>iOS and Romanian language</title>
		<link>http://blog.i18n.ro/ios-and-romanian-language/</link>
		<comments>http://blog.i18n.ro/ios-and-romanian-language/#comments</comments>
		<pubDate>Sat, 12 Mar 2011 09:58:43 +0000</pubDate>
		<dc:creator>sorin</dc:creator>
				<category><![CDATA[i18n]]></category>
		<category><![CDATA[Input]]></category>
		<category><![CDATA[Output]]></category>
		<category><![CDATA[Readiness]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[dictionary]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[Romanian]]></category>
		<category><![CDATA[voice]]></category>

		<guid isPermaLink="false">http://blog.i18n.ro/?p=531</guid>
		<description><![CDATA[First I have to confess that I&#8217;m pleased about the amount of attention Apple gave to supporting Romanian language on iOS 4.3 (iPhone/iPad/iPod). I remember reporting few bugs to them regarding Romanian support and I was glad to discover that &#8230; <a href="http://blog.i18n.ro/ios-and-romanian-language/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>First I have to confess that I&#8217;m pleased about the amount of attention Apple gave to supporting Romanian language on iOS 4.3 (iPhone/iPad/iPod). I remember reporting few bugs to them regarding Romanian support and I was glad to discover that they were addressed in the next releases. It looks that they do care about the feedback they get, even if you do not have any kind of feedback regarding how they deal with a reported bug.<span id="more-531"></span></p>
<p>Still with current iOS there are few problems with the <strong>Voice Control</strong> and romanian diacritics. Romanian language has only a small number of diacritical characters but it looks that speaking fails to recognize them.</p>
<p>English voice recognition and voice over used in iOS could be easily be tuned to support romanian diacritics.</p>
<ul>
<li>ș &#8211; reads like <span style="color: #888888;">sh</span> in shut</li>
<li>ț &#8211; reads like <span style="color: #888888;">zz</span> in pizza</li>
<li>ă &#8211; reads like <span style="color: #888888;">a</span> in above</li>
<li>î &#8211; <a href="http://en.wikipedia.org/wiki/Close_central_unrounded_vowel">close central unrounded vowel</a></li>
<li>â &#8211; reads the same as î</li>
</ul>
<p>More details regarding phonetic reading of romanian characters can be found on <a href="http://en.wikipedia.org/wiki/Romanian_alphabet">wikipedia</a>.</p>
<p>In addition to the voice issues listed about there is another very annoying bug inside the Romanian keyboard dictionary. Inside the default dictionary there is the word &#8220;<strong>La</strong>&#8220;, with the first letter uppercase. This is an extremely common work in Romanian and the auto-correct function will try to replace every &#8220;la&#8221; with &#8220;La&#8221;, making typing very hard. Probably this is one of the reasons why most romanians are disabling the auto-correct functionality.</p>
<p>I contacted Apple again and I hope they will solve these bugs soon. And from my Romanian friends, I expect some replies with their experience and maybe some likes on Facebook if they encountered the same problems.</p>
<p><strong>Update #1</strong> &#8211; Also I have to mention the the Romanian keyboard lacks the Romanian quotation marks:</p>
<ul>
<li>U+201E , U+201d &#8211; first level</li>
<li>U+00AB , U+00BB  - second level</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.i18n.ro/ios-and-romanian-language/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Examples of internationalizing keyboard shortcuts</title>
		<link>http://blog.i18n.ro/examples-of-internationalizing-keyboard-shortcuts/</link>
		<comments>http://blog.i18n.ro/examples-of-internationalizing-keyboard-shortcuts/#comments</comments>
		<pubDate>Fri, 16 Apr 2010 15:02:54 +0000</pubDate>
		<dc:creator>sorin</dc:creator>
				<category><![CDATA[i18n]]></category>
		<category><![CDATA[Input]]></category>
		<category><![CDATA[Readiness]]></category>
		<category><![CDATA[keyboard]]></category>

		<guid isPermaLink="false">http://blog.i18n.ro/examples-of-internationalizing-keyboard-shortcuts/</guid>
		<description><![CDATA[This article tries to complete a previous article regarding internationalization of keyboard shortcuts. I decided to analyze  a few cases, in order to explain better how we should define keyboard shortcuts in a way that will keep them working on &#8230; <a href="http://blog.i18n.ro/examples-of-internationalizing-keyboard-shortcuts/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This article tries to complete a previous article regarding <a href="blog.i18n.ro/are-we-supposed-to-localize-keyboard-shortcuts/">internationalization of keyboard shortcuts</a>. I decided to analyze  a few cases, in order to explain better how we should define keyboard shortcuts in a way that will keep them working on most international keyboards.<span id="more-340"></span></p>
<p>In order to keep the article simple I will ignore the modifiers state and I will explain only key related issues. Making modifiers work on different platforms is, usually, not a big deal.</p>
<h2>Example #1: Latin letters &#8211; CTRL+S (Save)</h2>
<p>You may think that foreign language users are using other letters for defining the Save action. For example Save is Bruscar in Spanish so you may think that they are inclined to use Ctrl+B to save. No, this isn&#8217;t happening. I wasn&#8217;t able to identify any application that is localizing these shortcuts.</p>
<p>Many are forgetting that the most important function of the keyboard shortcuts is the accessibility or the ease of use. It&#8217;s important to have common used functions easy to access: imagine you would have to press 4 keys spread all over the keyboard in order to access a common function like Save.</p>
<p>So we may consider that we could check the character code returned by the keyboard event in order to detect the shortcut. This will not work in cases like Greek keyboard where the same key will produce the sigma character(σ).</p>
<p>On Windows luckily Microsoft introduced the <strong>virtual key codes</strong> and any keyboard layout will generate VK_KEY_S (same code as ASCII character &#8216;S&#8217;). They did a very good job in defining virtual key codes for all keys including special ones like ESC, Del, Ins, …</p>
<p>On Windows it&#8217;s a good idea to <strong>define keyboard shortcuts using virtual keys for most keys</strong>. Yes, but only most, not all, because there is a small set of them that are dependent on the current keyboard layout being selected. I call these keys OEM keys because this is how they are named VK_OEM_&#8230;. and they are the key<img src="http://i18n.poi.ro/files/2010/04/041610_1500_Examplesofi1.jpg" alt="" /></p>
<p><span style="color: #4f81bd; font-size: 9pt;"><strong>Figure 1 OEM Keys<br />
</strong></span></p>
<p>On the above layout there are 11 keys, called OEM keys that do have different virtual keycodes on localized keyboard layouts. The problem is that there may have values from a range of around ~16 values and that the characters produced by them are not consistent.</p>
<h2>Example #2: Zoom-in/out using Ctrl+Plus/Minus on small keyboard layout or from the keypad</h2>
<p>First we have two sets of Plus/Minus keys on a normal keyboard layout and it would be a mistake to consider them the same. For the keypad it is simple, by using the virtual keycodes they will work just fine (VK_ADD and VK_SUBTRACT).</p>
<p>Now the problem with the Plus and Minus from the US English keyboard layout is that they are OEM keys and if you use their codes (VK_OEM_MINUS and VK_OEM_PLUS) you will have problems with around 1/3 of the foreign keyboard layouts. For example on French layouts the zoom-in will work because the key is using the same code bug the zoom-out will not work because there is no such virtual key on the entire French layout.</p>
<p><img src="http://i18n.poi.ro/files/2010/04/041610_1500_Examplesofi2.png" alt="" /></p>
<p><span style="color: #4f81bd; font-size: 9pt;"><strong>Figure 2 Plus and Minus from US English layout.<br />
</strong></span></p>
<p>The easy workaround for this problem is to fallback to character code verification if the key event does not match any current keyboard shortcut.</p>
<h1>Visual representation of keyboard shortcuts</h1>
<p>Especially if you want to use the OEM keys in shortcuts you will have to generate the shortcuts text description at runtime because this text depends on the current keyboard layout. If the user switches the keyboard layout the shortcut text (description) may change.</p>
<p>I managed to find an application, <a href="http://mpc-hc.sourceforge.net/">MediaPlayer Classic</a>, that does let the user define the shortcuts using both virtual keys and character codes.</p>
<p><a href="http://mpc-hc.sourceforge.net/"><img src="http://i18n.poi.ro/files/2010/04/041610_1500_Examplesofi3.png" border="0" alt="" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.i18n.ro/examples-of-internationalizing-keyboard-shortcuts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Optimal Windows keyboard settings for Romanian programmers</title>
		<link>http://blog.i18n.ro/optimal-windows-keyboard-settings-for-romanian-programmers/</link>
		<comments>http://blog.i18n.ro/optimal-windows-keyboard-settings-for-romanian-programmers/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 09:30:14 +0000</pubDate>
		<dc:creator>sorin</dc:creator>
				<category><![CDATA[Input]]></category>
		<category><![CDATA[Romanian]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[language]]></category>
		<category><![CDATA[r]]></category>

		<guid isPermaLink="false">http://blog.i18n.ro/optimal-windows-keyboard-settings-for-romanian-programmers/</guid>
		<description><![CDATA[Here is how you should configure you keyboard layouts in order to be a able to write code, English and Romanian text as easy as possible. Remember that using these settings you can enter Romanian characters using ALT-GR even when &#8230; <a href="http://blog.i18n.ro/optimal-windows-keyboard-settings-for-romanian-programmers/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Here is how you should configure you keyboard layouts in order to be a able to write code, English and Romanian text as easy as possible.<span id="more-277"></span></p>
<p>Remember that using these settings you can enter Romanian characters using ALT-GR even when current language is English. This is important because if you do not follow this you may have problems in Microsoft Office because the English spellchecker will not work because it will be confused by the current language settings.&nbsp;</p>
<p><img src="http://i18n.poi.ro/files/2009/08/081409_0929_OptimalWind11.png" alt="" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.i18n.ro/optimal-windows-keyboard-settings-for-romanian-programmers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Keyboard shortcuts and mnemonics or accelerators are not the same thing!</title>
		<link>http://blog.i18n.ro/keyboard-shortcuts-and-mnemonics-or-accelerators-are-not-the-same-thing/</link>
		<comments>http://blog.i18n.ro/keyboard-shortcuts-and-mnemonics-or-accelerators-are-not-the-same-thing/#comments</comments>
		<pubDate>Tue, 23 Dec 2008 15:30:27 +0000</pubDate>
		<dc:creator>sorin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[accelerator]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[mnemonics]]></category>
		<category><![CDATA[shortcuts]]></category>

		<guid isPermaLink="false">http://blog.i18n.ro/?p=121</guid>
		<description><![CDATA[Over the time I&#8217;ve found that there are misunderstandings between the concept of the keyboard shortcuts and mnemonics. I will try to clarify this problem because the differences are important specially from the point of view of software localization. The &#8230; <a href="http://blog.i18n.ro/keyboard-shortcuts-and-mnemonics-or-accelerators-are-not-the-same-thing/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Over the time I&#8217;ve found that there are misunderstandings between the concept of the <strong>keyboard shortcuts</strong> and <strong>mnemonics</strong>. I will try to clarify this problem because the differences are important specially from the point of view of software localization.<span id="more-121"></span></p>
<div id="attachment_125" class="wp-caption alignright" style="width: 270px"><img class="size-full wp-image-125" src="http://i18n.poi.ro/files/2008/12/keyboard_shortcuts_mnemonics.png" alt="Keyboard shortcuts in green and mnemonics in yellow." width="260" height="288" /><p class="wp-caption-text">Keyboard shortcuts in green and mnemonics in yellow.</p></div>
<p>The best keyboard related definition I&#8217;ve found for mnemonic it was on <a href="http://java.sun.com/products/jlf/ed2/book/HIG.Glossary.html#51661">Sun Java glossary</a>:</p>
<blockquote><p><strong>mnemonic</strong> &#8211; An underlined alphanumeric character, typically in a menu title, menu item, or the text of a button or component. A mnemonic shows the user which key to press (in conjunction with the Alt key) to activate a command or navigate to a component.</p></blockquote>
<p>If you had Win32 experience you may call them &#8220;menu accelerators&#8221;. They define the letter used for triggering them by using Ampersand (&amp;) inside the menu text. I would not recommend the usage of &#8220;accelerator&#8221; term because looking over the net I&#8217;ve found that in many cases it does refer to keyboard shortcuts.</p>
<p>If you are wondering why it&#8217;s important to clearly distinguish between them: it&#8217;s because the mnemonics are changing when the UI language is localized but the keyboard 	<a href="http://blog.i18n.ro/are-we-supposed-to-localize-keyboard-shortcuts/">shortcuts are not supposed to be localized</a>.<br />
.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.i18n.ro/keyboard-shortcuts-and-mnemonics-or-accelerators-are-not-the-same-thing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Are we supposed to localize keyboard shortcuts?</title>
		<link>http://blog.i18n.ro/are-we-supposed-to-localize-keyboard-shortcuts/</link>
		<comments>http://blog.i18n.ro/are-we-supposed-to-localize-keyboard-shortcuts/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 14:37:32 +0000</pubDate>
		<dc:creator>sorin</dc:creator>
				<category><![CDATA[Input]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[shortcuts]]></category>

		<guid isPermaLink="false">http://blog.i18n.ro/?p=85</guid>
		<description><![CDATA[When I&#8217;m talking about keyboard shortcuts to things like Ctrl-S or even one key shortcuts like &#8216;A&#8217; (used to Archive an email on Gmail). On the other side the mnemonics, known as hotkeys or the underlined letters in menus or &#8230; <a href="http://blog.i18n.ro/are-we-supposed-to-localize-keyboard-shortcuts/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When I&#8217;m talking about keyboard shortcuts to things like Ctrl-S or even one key shortcuts like &#8216;A&#8217; (used to Archive an email on Gmail). On the other side the mnemonics, known as hotkeys or the underlined letters in menus or other GUI controls are clearly something that should be localized and I not going to argue about this.<span id="more-85"></span></p>
<p>I&#8217;ve did some research to see how different companies are dealing with the shortcuts when people are using different languages and different keyboard layouts. Here are a short list of my results:</p>
<ul>
<li>If possible the shortcut is not changed</li>
<li>If a key is not available on a specific layout we should try to use the same physical position</li>
<li>There should be no link between application language and keyboard layouts. It&#8217;s a mistake to consider that application language will match the keyboard layout. I&#8217;ll give you just an example: in Romania over 95% of the computers are using US keyboard layout and the other 5% are using one of the 4-5 different Romanian keyboard layouts.</li>
<li>some people are using multiple keyboard layouts &#8211; usually they are power users and we can&#8217;t ignore them</li>
<li>keyboard layouts can be switched anytime</li>
<li>characters are safe to be used only if they are Latin</li>
</ul>
<h3>Physical position rules</h3>
<p>I think that the physical position of a key is more important than the letter printed on it. Here are my arguments:</p>
<ul>
<li>human brain is learning the shortcuts by hand movements (see <a href="http://en.wikipedia.org/wiki/Classical_conditioning">Pavlov&#8217;s dog experiment</a>)</li>
<li>it&#8217;s compatible with the usage of multiple keyboard layouts</li>
</ul>
<p>But it&#8217;s not always so simple: we can&#8217;t expect that the French users would swap the usage of Ctrl-Q with Ctrl-A ( Quit vs Select All) just because they are using different layouts. So a basic rule would be to stick to the layout for letters and numbers BUT try to use the physical position for other keys.</p>
<p>Anyway is high likely that people using multiple layouts would choose alike layouts (derived from the same root).</p>
<h2>One-to-one key matching</h2>
<p>Because the number of keys is the same we have to find a way of remapping the keys so all shortcuts working on US to be usable on other layouts. When I&#8217;m referring to keys, I&#8217;m referring to the hardware keys.</p>
<h2>Case study</h2>
<table border="0">
<tbody>
<tr>
<th>key category</th>
<th>US</th>
<th>French</th>
<th>Turkish</th>
<th>Arabic</th>
<th>Details</th>
</tr>
<tr>
<td>letters</p>
<p>(26)</td>
<td>Q</td>
<td>swapped to A</td>
<td>moved where = was</td>
<td>same pos.<br />
diff char</td>
<td>We should follow layout movements for all letter keys.</td>
</tr>
<tr>
<td>signs (OEMs)</p>
<p>(11-12)</td>
<td>-_ (minus after 0)</td>
<td>now -_ is moved where =+ was</td>
<td>obtained with Shift-/</td>
<td>-</td>
<td rowspan="2">Some of the OEM keys are used in pairs and it&#8217;s more important to keep key-pairs together than keeping the symbols on them.</td>
</tr>
<tr>
<td>signs (OEMs)</p>
<p>(11-12)</td>
<td>=+ (plus before backspace)</td>
<td>=+ is moved where / was.</p>
<p>note1: as you can observe these keys are no longer in pairs.</td>
<td>moved in the place of &#8216;&#8221;</p>
<p>note1: as you can observe these keys are no longer in pairs.
</td>
<td>-</td>
</tr>
<tr>
<td>numeric</p>
<p>(10)</td>
<td>1</td>
<td>1 (produced with Shift)</td>
<td>1</td>
<td>1</td>
<td>We should not request French users to press Ctrl+Shift+1 instead of Ctrl+1 just because their keyboard are producing numbers only with shift pressed.</td>
</tr>
<tr>
<td>others</p>
<p>(&#8230;)</td>
<td colspan="4">F1, Backspace, Space, numpad ones, &#8230;.</td>
<td>We should have no problems with these if we are using virtual keys/scan codes.</td>
</tr>
</tbody>
</table>
<blockquote><p>Question: <strong>How do I make OS X tell me that the key pressed by the user was &#8216;q&#8217; when current layout is Arabic?</strong></p>
<p>Rules:</p>
<ul>
<li>we are not allowed to assume it&#8217;s a &#8216;q&#8217; just because the key code is the same, maybe it&#8217;s a Arabic DVORAK keyboard!.</li>
<li>the shortcuts cannot be hardcoded (user can edit them)</li>
</ul>
</blockquote>
<p>On Windows it does work 98% using virtual key codes and you can use them to extract this info, but on OS X the key codes (even Apple call them sometimes virtual key codes) they are some kind of scan codes. For the rest of 2% you have to do some small hacks with the OEMs.</p>
<h2>Current code</h2>
<p><code><br />
case kEventRawKeyDown:<br />
  {<br />
    unsigned char macChar;<br />
    unsigned int keycode;<br />
    unsigned int modifiers;<br />
    unsigned int keyboardtype;</p>
<p>    OSStatus eventParamStatus = GetEventParameter( inEvent, kEventParamKeyMacCharCodes, typeChar, NULL, sizeof(macChar), NULL, &amp;macChar);<br />
    GetEventParameter(inEvent, kEventParamKeyCode, typeUInt32, NULL, sizeof(keycode), NULL, &amp;keycode);<br />
    GetEventParameter(inEvent, kEventParamKeyModifiers, typeUInt32, NULL, sizeof(modifiers), NULL, &amp;modifiers);<br />
    GetEventParameter(inEvent, kEventParamKeyboardType, typeUInt32, NULL, sizeof(keyboardtype), NULL, &amp;keyboardtype);</p>
<p>   // kEventParamKeyMacCharCodes<br />
   // for Latin characters it does behaves like Windows<br />
   // for !Latin it does not return consistent data: on Arabic it does return the same as on US but on French it does return French specific characters for the OEM keys.<br />
...<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.i18n.ro/are-we-supposed-to-localize-keyboard-shortcuts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Virtual key codes on Apple OS X</title>
		<link>http://blog.i18n.ro/virtual-key-codes-on-apple-os-x/</link>
		<comments>http://blog.i18n.ro/virtual-key-codes-on-apple-os-x/#comments</comments>
		<pubDate>Tue, 09 Dec 2008 17:20:47 +0000</pubDate>
		<dc:creator>sorin</dc:creator>
				<category><![CDATA[OS X]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[Input]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[virtual key]]></category>

		<guid isPermaLink="false">http://blog.i18n.ro/?p=30</guid>
		<description><![CDATA[On Windows, keyboard events are reporting scan codes, virtual key codes and characters. If you want to deal with keyboard shortcuts and be able to use them in an international context you have to use the virtual key codes. Let’s &#8230; <a href="http://blog.i18n.ro/virtual-key-codes-on-apple-os-x/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>On Windows, keyboard events are reporting scan codes,  virtual key codes and characters. If you want to deal with keyboard shortcuts and be able to use them in an international context you have to use the virtual key codes.<span id="more-30"></span><br />
Let’s say that we want to implement <code>Ctrl+A</code> shortcut. In this case all we have to do is to look after <code>VK_A</code> virtual key.</p>
<ul>
<li>VK_A code is present on any keyboard layout even if the character produced is not A</li>
</ul>
<ul>
<li> usually is on the same position, it does move only on some layouts like French <a href="http://en.wikipedia.org/wiki/AZERTY">AZERTY</a>, and it’s  logical to be moved – if the keyboard has an &#8220;A&#8221; printed on it user is supposed to press this button – we can’t request French users to switch <code>Ctrl-Q</code> and <code>Ctrl-A</code> just because they have a different keyboard layout.</li>
</ul>
<ul>
<li> we can’t rely on the characters because many layouts do not produce Latin characters or some keys are not even producing a character (dead keys).</li>
</ul>
<ul>
<li> it’s not safe to use the scan codes because they will break on AZERTY, <a href="http://en.wikipedia.org/wiki/Dvorak_Simplified_Keyboard">DVORAK </a>and other layouts.</li>
</ul>
<p>I think I do not have to explain more why virtual keys are the way we must store and process keyboard shortcuts.<br />
And now let’s try the same thing on Apple OS X platform. It does seem that apple has only 2 properties for keyboard events: key codes (<code>kEventParamKeyCode</code>) and characters. They consider key codes to be some sort of virtual keys, but in fact they are just physical key positions and this does mean that they are some sort of hardware independent scan codes.<br />
So now I’m stuck with this big question:</p>
<blockquote><p><strong><span style="color: #ff6600"><em>How do I detect that the user pressed <code>Command+A</code> under OS X in a way that will work with any keyboard layout?</em></span></strong></p></blockquote>
<p>I should add that the user can have multiple keyboard layouts installed.</p>
<h3>External links</h3>
<ul>
<li><a href="http://blog.janik.cz/archives/2006/08/02/T23_14_53/">Carbon keyboard events</a></li>
<li><a href="http://blakeseely.com/blog/archives/2006/09/26/virtual-keys/">Virtual keys on Apple</a></li>
<li><a href="http://rentzsch.com/macosx/virtualKeyCodes">http://rentzsch.com/macosx/virtualKeyCodes</a> &#8211; Article about Virtual Key Codes on OS X</li>
<li><a href="http://developer.apple.com/documentation/Carbon/Reference/Carbon_Event_Manager_Ref/Reference/reference.html">Carbon Event Manager Reference</a></li>
<li><a href="http://developer.apple.com/documentation/Carbon/Conceptual/UnderstandTextInput_TSM/tinptsm_concepts/chapter_2_section_3.html">Text Input Event Handling for Applications With Carbon</a></li>
<li><a href="http://developer.apple.com/qa/qa2005/qa1446.html">Losing the character code when using the control key</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.i18n.ro/virtual-key-codes-on-apple-os-x/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Keyboard shortcuts in an international context</title>
		<link>http://blog.i18n.ro/keyboard-shortcuts-in-an-international-context/</link>
		<comments>http://blog.i18n.ro/keyboard-shortcuts-in-an-international-context/#comments</comments>
		<pubDate>Tue, 07 Oct 2008 15:58:13 +0000</pubDate>
		<dc:creator>sorin</dc:creator>
				<category><![CDATA[Input]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[key codes]]></category>
		<category><![CDATA[keyboard]]></category>

		<guid isPermaLink="false">http://blog.i18n.ro/?p=45</guid>
		<description><![CDATA[One common error in internationalization is to think that all shortcuts must be translated. People forgot that one of the major advantages of the shortcuts is that they are memorized their position on the keyboard and not by the sign &#8230; <a href="http://blog.i18n.ro/keyboard-shortcuts-in-an-international-context/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>One common error in internationalization is to think that all shortcuts must be translated. People forgot that one of the major advantages of the shortcuts is that they are memorized their position on the keyboard and not by the sign on the key.<span id="more-45"></span></p>
<p>From my point of view there are two types of keyboard shortcuts: the mnenonics (hot keys) and the normal keyboard shortcuts. Mnemonics are the underlined letters and they are fully translatable.<img class="alignright size-full wp-image-48" src="http://i18n.poi.ro/files/2008/12/menus_edit.gif" alt="shortcut types" width="253" height="189" /></p>
<h2><sub>Position is more important than the letter on the key.</sub></h2>
<p>One simple example is the Cut-Copy-Paste group they are all consecutive keys on the keyboard and are accesible only with one hand (Ctrl-X, Ctrl-C, Ctrl-V).</p>
<p>Anoher example would be the Undo function that is using Ctrl-Z on English. On a French keyboard it should map to Ctrl-Y because &#8216;Y&#8217; and &#8216;Z&#8217; are switched on these keyboards and we need to keep the position.</p>
<h3>Use the virtual key codes for remembering the shortcuts</h3>
<p>In order to be able to make the shortcuts available on multiple keyboard layouts you need to store the virtual key codes reported by the keyboard not the letter reported. There are many people using multiple keyboard shortcuts on their computer and they are switching from one layout to another very often. So you can&#8217;t rely on letters reported by OS but you can safely use the virtual key codes reported because these are not changing when the used is changing the layouts. In fact virtual key codes are.</p>
<p>You can find a full list of virtual key codes <a href="http://www.kbdedit.com/manual/low_level_vk_list.html">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.i18n.ro/keyboard-shortcuts-in-an-international-context/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using apc
Page Caching using apc

Served from: blog.i18n.ro @ 2012-02-07 16:51:56 -->
