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>KBDSetAttachCallback</title>
10</head>
11
12<body>
13
14<h1>KBDSetAttachCallback</h1>
15
16
17<h2>Syntax</h2>
18
19<dl>
20<dd><pre><code>#include &lt;revolution/kbd.h&gt;</code></pre>
21  </dd>
22<dd><pre><code>KBDDevCallbackF KBDSetAttachCallback (KBDDevCallbackF fn);</code></pre>
23  </dd>
24</dl>
25
26<h2>Arguments</h2>
27
28<TABLE border="1" cellpadding="3" cellspacing="0.1">
29  <tr>
30<TD width="120" bgcolor="#ffffe8"><code><em><strong>fn</strong></em></code></TD>
31<TD width="520">Pointer to a function to call back when a USB keyboard device is physically attached. </TD>
32    </tr>
33</TABLE>
34
35<h2>Return Values</h2>
36
37<TABLE border="1" cellpadding="3" cellspacing="0.1">
38  <tr>
39<TD width="120" bgcolor="#ffffe8"><code><em><strong>KBDDevCallbackF</strong></em></code></TD>
40<TD width="520">A pointer to the previous keyboard device attach callback.</TD>
41    </tr>
42</TABLE>
43
44<h2>Description</h2>
45
46<p>Registers a function with the USB keyboard library to call whenever a USB keyboard device is connected. The function pointer <CODE>typedef</CODE> <code>KBDDevCallbackF</code> is defined as follows.</p>
47
48
49
50<p><code>typedef struct _KBDDevEvent { <br> &nbsp; KBDChannel channel;<br> } KBDDevEvent;</code></p>
51
52
53
54<p><code>typedef void (*KBDDevCallbackF) (KBDDevEvent*);</code></p>
55
56
57
58<p>The <code>fn</code> function is called with a pointer to a <code>KBDDevEvent</code> structure that contains the channel (keyboard) that was attached.
59
60<p>You must always register the attach callback before calling the <code>KBDInit</code> function. Doing so ensures that the keyboard physically plugged into the console before <code>KBDInit</code> executes is the keyboard that will be attached.
61
62</p>
63
64
65
66<h2>See Also</h2>
67
68<p><a href="list.html">Keyboard API Function List</a></p>
69
70<h2>Revision History</h2><p></p>
71
72<P>
732007/10/03 Added a note about registering the attach callback.<br>2007/03/19 Initial version 0.1.</p>
74
75<hr>
76
77<hr><p>CONFIDENTIAL</p></body>
78</HTML>