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<h2>Syntax</h2> 17 18<dl> 19<dd><pre><code>#include <revolution/kbd.h></code></pre> 20 </dd> 21<dd><pre><code>typedef void (*KBDDevCallbackF) (KBDDevEvent *ev);</code></pre> 22 </dd> 23 24<dd><pre><code>KBDEc KBDInit (void *kbd_mem, KBDDevCallbackF attach_cb, KBDDevCallbackF detach_cb, KBDKeyCallbackF key_cb);</code></pre> 25 </dd> 26</dl> 27 28<h2>Arguments</h2> 29 30<TABLE border="1" cellpadding="3" cellspacing="0.1"> 31 <tr> 32<TD width="120" bgcolor="#ffffe8"><code><em><strong>kbd_mem</strong></em></code></TD> 33<TD width="520">User-allocated memory of <code>KBD_MEM_SIZE</code> for KBD library.</TD> 34 </tr> 35 36 <tr> 37<TD width="120" bgcolor="#ffffe8"><code><em><strong>attach_cb</strong></em></code></TD> 38<TD width="520">Pointer to user-implemented callback function for keyboard attach.</TD> 39 </tr> 40 41 <tr> 42<TD width="120" bgcolor="#ffffe8"><code><em><strong>detach_cb</strong></em></code></TD> 43<TD width="520">Pointer to user-implemented callback function for keyboard detach.</TD> 44 </tr> 45 46 <tr> 47<TD width="120" bgcolor="#ffffe8"><code><em><strong>key_cb</strong></em></code></TD> 48<TD width="520">Pointer to user-implemented callback function for keyboard input.</TD> 49 </tr> 50</TABLE> 51 52 53<h2>Return Values</h2> 54 55<TABLE border="1" cellpadding="3" cellspacing="0.1"> 56 57 <tr> 58<TD width="120" bgcolor="#ffffe8"><code><em><strong>KBDEc</strong></em></code></TD> 59<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> 60 </tr> 61 62</TABLE> 63 64<h2>Description</h2> 65 66<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. 67 68You 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>. 69 70<h2>See Also</h2> 71 72<p><a href="list.html">Keyboard API Function List</a></p> 73 74<h2>Revision History</h2><p></p> 75 76<P> 772008/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> 78 79<hr> 80 81<hr><p>CONFIDENTIAL</p></body> 82</HTML>