1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3
4<head>
5<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
6<META name="GENERATOR" content="Microsoft FrontPage 5.0">
7<META http-equiv="Content-Style-Type" content="text/css">
8<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css">
9<title>KBDTranslateHidCode</title>
10</head>
11
12<body>
13
14<h1>KBDTranslateHidCode</h1>
15
16<h2>Syntax</h2>
17<dl><dd><pre class="construction">
18#include &lt;revolution/kbd.h&gt;
19
20KBDUnicode KBDTranslateHidCode(KBDHIDCode hid, KBDModState modState, KBDCountryCode co);
21</pre></dd></dl>
22
23<h2>Arguments</h2>
24<TABLE class="arguments" border="1" >
25  <tr>
26<TH>hid</TH>
27<TD>USB HID code to be translated.</TD>
28  </tr>
29  <tr>
30<TH>modState</TH>
31<TD>Keyboard modifier state value to use in the translation.</TD>
32  </tr>
33  <tr>
34<TH>co</TH>
35<TD>Country code of the map to be used.</TD>
36  </tr>
37</TABLE>
38
39<h2>Return Values</h2>
40<TABLE class="arguments" border="1" >
41  <tr>
42<TH>KBDUnicode</TH>
43<TD>Returns a Unicode value that represents the translated key. It will return <code>KBK_Error</code> under the following conditions:
44<ul><li>Keyboard library is not initialized</li>
45<li>Country code <SPAN class="argument">co</SPAN> is invalid.</li>
46<li>HID code <SPAN class="argument">hid</SPAN> represents an error code, not a key</li>
47        </ul>
48Returns <code>KBK_Void</code> if the key has no defined translation (for example, if <code>KBD_MS_ALTGR</code> is set but the map has no <CODE>AltGr</CODE>).)
49    </TD>
50  </tr>
51</TABLE>
52
53<h2>Description</h2>
54<p>Given a USB HID code, modifier state, and country code, this function will return the <code>KBDUnicode</code> value from the appropriate keyboard map.</p>
55<p>Note that a <code>KBDUnicode</code> value may be private to the KBD library. All keys are provided with a <code>KBDUnicode</code> value. For the function, editing, arrow, and other special keys, custom (private) Unicode values are used. These private Unicode values are all in the range of <code>0xf000-0xf1ff</code>; they should <b>never</b> be used for external data exchange. They should also not be confused with private Unicode values that may be used elsewhere in the Revolution SDK or other SDKs. The KBD private Unicode values should only be used with keyboard-related functions.</p>
56<p>For more information about <code>KBDUnicode</code>, refer to <a href="intro.html#KBDUnicode">Introduction</a>.</p>
57<p>If the modifier state <code>KBD_MS_SHIFTED_KEY</code> is not set, the translate function will ignore <code>KBD_MS_SHIFT</code>, <code>KBD_MS_CAPS_LOCK</code>, and <code>KBD_MS_NUM_LOCK</code> if one or more of the following modifiers are also on:</p>
58<ul>
59<li><code>KBD_MS_CTRL</code></li>
60<li><code>KBD_MS_ALT</code></li>
61<li><code>KBD_MS_GUI</code></li>
62<li><code>KBD_MS_EXTRA</code></li>
63</ul>
64<p>The <code>KBD_MS_SHIFTED_KEY</code> modifier state is off by default.</p>
65
66<h2>See Also</h2>
67<P class="reference">
68<a href="list.html">Keyboard Functions</a><BR><a href="intro.html">Introduction</a>
69</p>
70
71<h2>Revision History</h2>
72<P>2007/03/27 Initial version.<br>
73</p>
74
75<hr><p>CONFIDENTIAL</p></body>
76</HTML>