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>KBDInit</title> 10</head> 11 12<body> 13 14<h1>KBDInit</h1> 15 16 17<h2>Syntax</h2> 18 19<dl> 20<dd><pre><code>#include <revolution/kbd.h></code></pre> 21 </dd> 22<dd><pre><code>typedef void (*KBDDevCallbackF) (KBDDevEvent *ev);</code></pre> 23 </dd> 24 25<dd><pre><code>KBDEc KBDInit (void *kbd_mem, KBDDevCallbackF attach_cb, KBDDevCallbackF detach_cb, KBDKeyCallbackF key_cb);</code></pre> 26 </dd> 27</dl> 28 29<h2>Arguments</h2> 30 31<TABLE border="1" cellpadding="3" cellspacing="0.1"> 32 <tr> 33<TD width="120" bgcolor="#ffffe8"><code><em><strong>kbd_mem</strong></em></code></TD> 34<TD width="520">User-allocated memory of <code>KBD_MEM_SIZE</code> for KBD library.</TD> 35 </tr> 36 37 <tr> 38<TD width="120" bgcolor="#ffffe8"><code><em><strong>attach_cb</strong></em></code></TD> 39<TD width="520">Pointer to user-implemented callback function for keyboard attach.</TD> 40 </tr> 41 42 <tr> 43<TD width="120" bgcolor="#ffffe8"><code><em><strong>detach_cb</strong></em></code></TD> 44<TD width="520">Pointer to user-implemented callback function for keyboard detach.</TD> 45 </tr> 46 47 <tr> 48<TD width="120" bgcolor="#ffffe8"><code><em><strong>key_cb</strong></em></code></TD> 49<TD width="520">Pointer to user-implemented callback function for keyboard input.</TD> 50 </tr> 51</TABLE> 52 53 54<h2>Return Values</h2> 55 56<TABLE border="1" cellpadding="3" cellspacing="0.1"> 57 58 <tr> 59<TD width="120" bgcolor="#ffffe8"><code><em><strong>KBDEc</strong></em></code></TD> 60<TD width="520">Keyboard error code. <br>If successful, the function returns <code>KBD_SUCCESS</code>.<br>If the library is already initialized, the function returns <code>KBD_ERR_ALREADY_INITIALIZED</code>.<br></TD> 61 </tr> 62 63</TABLE> 64 65<h2>Description</h2> 66 67<p>Initializes the USB keyboard library. The KBD library depends on the HID library, so before calling <code>KBDInit</code>, you should initialize the HID library by calling the <code>HIDOpenAsync</code> function. 68 69You must call <code>KBDInit</code> before using the USB keyboard library. Moreover, you need to initialize at least one market (region) after you have called <code>KBDInit</code>. 70 71<h2>See Also</h2> 72 73<p><a href="list.html">Keyboard API Function List</a></p> 74 75<h2>Revision History</h2><p></p> 76 77<P> 782008/09/26 Deleted non-implemented return values. Corrected the explanation to state that this function is called after <CODE>HIDOpenAsync</CODE>.<br>2007/10/08 Added parameters according to the API change.<br>2007/10/03 Added a note about registering the attach callback.<br>2007/03/19 Initial version 0.1.</p> 79 80<hr> 81 82<hr><p>CONFIDENTIAL</p></body> 83</HTML>