<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd"> <html> <!-- Created by texi2html 1.76 --> <!-- Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author) Karl Berry <karl@freefriends.org> Olaf Bachmann <obachman@mathematik.uni-kl.de> and many others. Maintained by: Many creative people <dev@texi2html.cvshome.org> Send bugs and suggestions to <users@texi2html.cvshome.org> --> <head> <title>Crystal Space 1.2.1: C.2.3 Input Helper Changes</title> <meta name="description" content="Crystal Space 1.2.1: C.2.3 Input Helper Changes"> <meta name="keywords" content="Crystal Space 1.2.1: C.2.3 Input Helper Changes"> <meta name="resource-type" content="document"> <meta name="distribution" content="global"> <meta name="Generator" content="texi2html 1.76"> <meta http-equiv="Content-Type" content="text/html; charset=us-ascii"> <style type="text/css"> <!-- a.summary-letter {text-decoration: none} pre.display {font-family: serif} pre.format {font-family: serif} pre.menu-comment {font-family: serif} pre.menu-preformatted {font-family: serif} pre.smalldisplay {font-family: serif; font-size: smaller} pre.smallexample {font-size: smaller} pre.smallformat {font-family: serif; font-size: smaller} pre.smalllisp {font-size: smaller} span.sansserif {font-family:sans-serif; font-weight:normal;} ul.toc {list-style: none} --> </style> </head> <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000"> <a name="Api1_005f0-Input-Helper-Changes"></a> <a name="0"></a> <table cellpadding="1" cellspacing="1" border="0"> <tr><td valign="middle" align="left">[<a href="Api1_005f0-iEvent-Changes.html#0" title="Previous section in reading order"> < </a>]</td> <td valign="middle" align="left">[<a href="Api1_005f0-Container-Changes.html#0" title="Next section in reading order"> > </a>]</td> <td valign="middle" align="left"> </td> <td valign="middle" align="left">[<a href="Release-Notes.html#0" title="Beginning of this chapter or previous chapter"> << </a>]</td> <td valign="middle" align="left">[<a href="Release-Notes-1_005f0.html#0" title="Up section"> Up </a>]</td> <td valign="middle" align="left">[<a href="Licenses.html#0" title="Next chapter"> >> </a>]</td> <td valign="middle" align="left"> </td> <td valign="middle" align="left"> </td> <td valign="middle" align="left"> </td> <td valign="middle" align="left"> </td> <td valign="middle" align="left">[<a href="index.html#SEC_Top" title="Cover (top) of document">Top</a>]</td> <td valign="middle" align="left">[<a href="cs_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td> <td valign="middle" align="left">[<a href="cs_Index.html#0" title="Index">Index</a>]</td> <td valign="middle" align="left">[<a href="cs_abt.html#SEC_About" title="About (help)"> ? </a>]</td> </tr></table> <hr size="1"> <h3 class="subsection"> C.2.3 Input Helper Changes </h3> <a name="1"></a> <h4 class="subsubheading"> Input Definitions </h4> <p>The file <tt>‘csutil/inpnames.h’</tt> has been renamed to <tt>‘inputdef.h’</tt>, and the following functions have been removed: </p> <ul> <li> <code>csTypeOfInputDef()</code> </li><li> <code>csParseKeyDef()</code> </li><li> <code>csGetKeyDesc()</code> </li><li> <code>csParseMouseDef()</code> </li><li> <code>csGetMouseDesc()</code> </li><li> <code>csParseJoystickDef()</code> </li><li> <code>csGetJoystickDesc()</code> </li></ul> <p>These functions allowed you to convert a string such as <kbd><kbd>Ctrl</kbd>+A</kbd>, <samp>‘JoystickX’</samp> or <samp>‘Alt+Mouse1’</samp> into values describing input events and vice versa. </p> <p>The way to do this is now, however, is to use <samp>‘csInputDefinition’</samp>, which resides in <tt>‘csutil/inputdef.h’</tt>. The preferred way to convert a string to a definition is to construct a <samp>‘csInputDefinition’</samp> from a <samp>‘char const*’</samp>; and the preferred way to convert a definition back to a string (perhaps constructed some other way) is via <code>csInputDefinition::ToString()</code>. </p> <p>There are also static helper methods in <samp>‘csInputDefinition’</samp> which accept arguments in a similar way to the old functions. These are convenience methods which perform the work of instantiating the object for you: </p> <ul> <li> <code>csInputDefinition::ParseKey()</code> </li><li> <code>csInputDefinition::GetKeyString()</code> </li><li> <code>csInputDefinition::ParseOther()</code> </li><li> <code>csInputDefinition::GetOtherString()</code> </li></ul> <a name="2"></a> <h4 class="subsubheading"> Mouse Corrections </h4> <p>Mouse buttons and axes used to be enumerated basis 1 (first mouse button was 1, Y axis was 2, etc). In keeping with good C/C++/Java/etc coding style, they are now basis-0 (first mouse button is 0, Y axis is 1, etc). </p> <a name="3"></a> <h4 class="subsubheading"> Joystick Corrections </h4> <p>The implementation of <samp>‘iJoystickDriver’</samp> has been fixed to treat joystick numbers consistently. Previously, on account of buggy implementation, some parts of the driver considered joystick numbers 0-based, while other parts considered them 1-based. It now uniformly treats joystick numbers as 0-based. This is consistent with button numbers for joysticks and mice, which are also basis-0. </p> <hr size="1"> <p> <font size="-1"> This document was generated using <a href="http://texi2html.cvshome.org/"><em>texi2html 1.76</em></a>. </font> <br> </p> </body> </html>