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>KBDSetModState</title>
10</head>
11
12<body>
13
14<h1>KBDSetModState</h1>
15
16<h2>Syntax</h2>
17<dl><dd><pre class="construction">
18#include &lt;revolution/kbd.h&gt;
19
20KBDEc KBDSetModState(KBDChannel ch, KBDModState modState);
21</pre></dd></dl>
22
23<h2>Arguments</h2>
24<TABLE class="arguments" border="1" >
25  <tr>
26<TH>ch</TH>
27<TD>Keyboard channel to set.</TD>
28  </tr>
29  <tr>
30<TH>modState</TH>
31<TD>A <code>KBDModState</code> value to set the current modifier state.</TD>
32  </tr>
33</TABLE>
34
35<h2>Return Values</h2>
36<TABLE class="arguments" border="1" >
37  <tr>
38<TH>KBDEc</TH>
39<TD>Keyboard error code. <code>KBD_SUCCESS</code> if the call was successful.<br><code>KBD_ERR_NOT_INITIALIZED</code> if the library was not initialized.<br><code>KBD_ERR_BAD_VALUE</code> if <SPAN class="argument">ch</SPAN> or <SPAN class="argument">modState</SPAN> is out of range.<br>
40    </TD>
41  </tr>
42</TABLE>
43
44<h2>Description</h2>
45<p>Sets the current modifier key state of the USB keyboard on channel <SPAN class="argument">ch</SPAN>. Normally, this function only lets you change these modifier bits:</p>
46<ul>
47<li><code>KBD_MS_CAPS_LOCK</code></li>
48<li><code>KBD_MS_NUM_LOCK</code></li>
49<li><code>KBD_MS_SCROLL_LOCK</code></li>
50<li><code>KBD_MS_LANG1</code></li>
51<li><code>KBD_MS_LANG2</code></li>
52<li><code>KBD_MS_SHIFTED_KEY</code></li>
53</ul>
54<p>The modifier key state for these bits is set according to the bits set in <SPAN class="argument">modState</SPAN>.</p>
55<p>If the bit <code>KBD_MS_SET_ALL</code> is set in <SPAN class="argument">modState</SPAN>, all bits in the keyboard modifier state are set.</p>
56<p>The modifier key state is used by <a href="KBDTranslateHidCode.html"><code>KBDTranslateHidCode</code></a> to correctly translate HID codes into Unicodes. The modifier state is normally controlled by the KBD library, although the application may take control of the locking states by calling <a href="KBDSetLockProcessing.html"><code>KBDSetLockProcessing</code></a>.</p>
57<p>The default value for the keyboard modifier state is <code>KBD_MS_NULL</code>.</p>
58
59<h2>See Also</h2>
60<P class="reference">
61<a href="list.html">Keyboard API Function List</a>
62</p>
63
64<h2>Revision History</h2>
65<P>
662007/03/19 Initial version. <br>
67</p>
68
69<hr><p>CONFIDENTIAL</p></body>
70</HTML>