Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > bad97183153701b09df5fae1052b1c30 > files > 3121

crystalspace-doc-1.2.1-5mdv2010.0.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Crystal Space 1.2.1: iInputBinder Struct Reference (Crystal Space 1.2.1 Public API Reference)</title>
<link href="tabs.css" rel="stylesheet" type="text/css">
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="head">
 <tr height="59">
  <td class="head" width="202" valign="bottom" style="padding-left:0;"><a href="http://www.crystalspace3d.org/"><img src="csblur.png" width="236" height="59" alt="CrystalSpace" border="0"></a></td>
  <td class="head"><h2>Public API Reference</h2></td>
 </tr>
 <tr height="11">
  <td colspan="2" class="headshadow" valign="top" style="padding-left:0;"><img src="csblurb.png" width="236" height="11" alt="" border="0"></td>
 </tr>
</table>
<div class="content">
<!-- Generated by Doxygen 1.5.3 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="modules.html"><span>Modules</span></a></li>
    <li><a href="namespaces.html"><span>Namespaces</span></a></li>
    <li class="current"><a href="classes.html"><span>Classes</span></a></li>
    <li><a href="files.html"><span>Files</span></a></li>
    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
  </ul>
</div>
<div class="tabs">
  <ul>
    <li><a href="classes.html"><span>Alphabetical&nbsp;List</span></a></li>
    <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
    <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
    <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
  </ul>
</div>
<h1>iInputBinder Struct Reference</h1><!-- doxytag: class="iInputBinder" --><!-- doxytag: inherits="iBase" -->SCF interface for <a class="el" href="classcsInputBinder.html" title="Use this class to bind input events (keypress, button press, mouse move, etc.">csInputBinder</a>, used to bind input events (keypress, button press, mouse move, etc.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="iutil_2binder_8h-source.html">iutil/binder.h</a>&gt;</code>
<p>
<div class="dynheader">
Inheritance diagram for iInputBinder:</div>
<div class="dynsection">
<p><center><img src="structiInputBinder__inherit__graph.png" border="0" usemap="#iInputBinder__inherit__map" alt="Inheritance graph"></center>
<map name="iInputBinder__inherit__map">
<area shape="rect" href="classscfImplementation2.html" title="scfImplementation2\&lt; csInputBinder, iInputBinder, iEventHandler \&gt;" alt="" coords="5,161,459,188"><area shape="rect" href="structiBase.html" title="This is the basic interface: all other interfaces should be derived from this one..." alt="" coords="204,7,260,33"><area shape="rect" href="classcsInputBinder.html" title="Use this class to bind input events (keypress, button press, mouse move, etc." alt="" coords="177,239,287,265"></map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div>

<p>
<a href="structiInputBinder-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structiInputBinder.html#f9c22268b61b357eb2982e8e2d163908">Axis</a> (unsigned cmd)=0</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the position of the given axis command.  <a href="#f9c22268b61b357eb2982e8e2d163908"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structiInputBinder.html#a7649345d9af9eca913ac1cb7e275fea">BindAxis</a> (<a class="el" href="classcsInputDefinition.html">csInputDefinition</a> const &amp;def, unsigned int cmd, int sensitivity=1)=0</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Bind an axis motion event to an axis command.  <a href="#a7649345d9af9eca913ac1cb7e275fea"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structiInputBinder.html#88e6c7239906339309cd0c7eab82c47f">BindButton</a> (<a class="el" href="classcsInputDefinition.html">csInputDefinition</a> const &amp;def, unsigned int cmd, bool toggle=false)=0</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Bind a button event to a button command.  <a href="#88e6c7239906339309cd0c7eab82c47f"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structiInputBinder.html#82ea6bef5f334831c251fb455131665a">Button</a> (unsigned cmd)=0</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the status of the given button command.  <a href="#82ea6bef5f334831c251fb455131665a"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structiInputBinder.html#c6e225b0c0b881ac98ad88d263b576b0">LoadConfig</a> (<a class="el" href="structiConfigFile.html">iConfigFile</a> *, const char *subsection=0)=0</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Load bindings from a configuration file.  <a href="#c6e225b0c0b881ac98ad88d263b576b0"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual <a class="el" href="structiEventHandler.html">iEventHandler</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structiInputBinder.html#c03ddf7eb4385e967bec294d3a9c4d5c">QueryHandler</a> ()=0</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get a pointer to the embedded iEventHander.  <a href="#c03ddf7eb4385e967bec294d3a9c4d5c"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structiInputBinder.html#2e7ad6cdbc829f380e9ab57b944e334f">SaveConfig</a> (<a class="el" href="structiConfigFile.html">iConfigFile</a> *, const char *subsection=0)=0</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Save bindings to a configuration file.  <a href="#2e7ad6cdbc829f380e9ab57b944e334f"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structiInputBinder.html#2ec10a42410f088450765b7a8eb704f5">UnbindAll</a> ()=0</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Remove all bindings.  <a href="#2ec10a42410f088450765b7a8eb704f5"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structiInputBinder.html#5ade82463225ad4f90f25b7278f11074">UnbindAxis</a> (unsigned cmd)=0</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Remove a binding.  <a href="#5ade82463225ad4f90f25b7278f11074"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structiInputBinder.html#18e8e97320f442b0fdfa60e3b2c051cf">UnbindButton</a> (unsigned cmd)=0</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Remove a binding.  <a href="#18e8e97320f442b0fdfa60e3b2c051cf"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
SCF interface for <a class="el" href="classcsInputBinder.html" title="Use this class to bind input events (keypress, button press, mouse move, etc.">csInputBinder</a>, used to bind input events (keypress, button press, mouse move, etc. 
<p>
) to commands which are represented by an unsigned integer. It is up to the application to specify the meaning of a command value. <p>
Example: <div class="fragment"><pre class="fragment"> <span class="keyword">enum</span> MyCommand = { Walk, Shoot, Jump, LookX, LookY };
 ...
 <a class="code" href="classcsRef.html" title="A smart pointer.">csRef&lt;iInputBinder&gt;</a> binder = ...;
 binder-&gt;BindButton (<a class="code" href="classcsInputDefinition.html" title="This class holds a description of a physical source of input events, such as a keyboard...">csInputDefinition</a> (<span class="stringliteral">"ctrl"</span>), Shoot);
 binder-&gt;BindAxis (<a class="code" href="classcsInputDefinition.html" title="This class holds a description of a physical source of input events, such as a keyboard...">csInputDefinition</a> (<span class="stringliteral">"mousex"</span>), LookX);
 ...
 <span class="keywordflow">if</span> (binder-&gt;Button (Shoot))
   ...
 <span class="keywordflow">else</span>
 {
   DoSomething (binder-&gt;Axis (LookX), binder-&gt;Axis (LookY));
 }
</pre></div> 
<p>Definition at line <a class="el" href="iutil_2binder_8h-source.html#l00055">55</a> of file <a class="el" href="iutil_2binder_8h-source.html">binder.h</a>.</p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="f9c22268b61b357eb2982e8e2d163908"></a><!-- doxytag: member="iInputBinder::Axis" ref="f9c22268b61b357eb2982e8e2d163908" args="(unsigned cmd)=0" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual int iInputBinder::Axis           </td>
          <td>(</td>
          <td class="paramtype">unsigned&nbsp;</td>
          <td class="paramname"> <em>cmd</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Returns the position of the given axis command. 
<p>

<p>Implemented in <a class="el" href="classcsInputBinder.html#7e96c7d5a76531b056026ef9624f6a47">csInputBinder</a>.</p>

</div>
</div><p>
<a class="anchor" name="a7649345d9af9eca913ac1cb7e275fea"></a><!-- doxytag: member="iInputBinder::BindAxis" ref="a7649345d9af9eca913ac1cb7e275fea" args="(csInputDefinition const &amp;def, unsigned int cmd, int sensitivity=1)=0" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual void iInputBinder::BindAxis           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classcsInputDefinition.html">csInputDefinition</a> const &amp;&nbsp;</td>
          <td class="paramname"> <em>def</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&nbsp;</td>
          <td class="paramname"> <em>cmd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>sensitivity</em> = <code>1</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Bind an axis motion event to an axis command. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>def</em>&nbsp;</td><td>Describes the physical axis to bind to. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>cmd</em>&nbsp;</td><td>The ID of the command to bind. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>sensitivity</em>&nbsp;</td><td>A multiplier for the axis command. </td></tr>
  </table>
</dl>
<dl class="remark" compact><dt><b>Remarks:</b></dt><dd>Note that cmd is used as an array index so the numbers you use should be consecutive, starting with 0. </dd></dl>

<p>Implemented in <a class="el" href="classcsInputBinder.html#f8a79f3996e5c12ea14fdf88cd65dcc0">csInputBinder</a>.</p>

</div>
</div><p>
<a class="anchor" name="88e6c7239906339309cd0c7eab82c47f"></a><!-- doxytag: member="iInputBinder::BindButton" ref="88e6c7239906339309cd0c7eab82c47f" args="(csInputDefinition const &amp;def, unsigned int cmd, bool toggle=false)=0" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual void iInputBinder::BindButton           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classcsInputDefinition.html">csInputDefinition</a> const &amp;&nbsp;</td>
          <td class="paramname"> <em>def</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&nbsp;</td>
          <td class="paramname"> <em>cmd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>toggle</em> = <code>false</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Bind a button event to a button command. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>def</em>&nbsp;</td><td>Describes the physical button to bind to. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>cmd</em>&nbsp;</td><td>The ID of the command to bind. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>toggle</em>&nbsp;</td><td>If true, button status is only toggled on keydown events. </td></tr>
  </table>
</dl>
<dl class="remark" compact><dt><b>Remarks:</b></dt><dd>Note that cmd is used as an array index so the numbers you use should be consecutive, starting with 0. Also note that there must be a 1:1 mapping between buttons and commands, that is, a button cannot issue multiple commands, and the same command cannot be bound to multiple buttons. If you require this, you must handle it in your application. Binding a button (or command) will remove any previous bindings involving the button or command. </dd></dl>

<p>Implemented in <a class="el" href="classcsInputBinder.html#ed7dd149f5614e7cb6745cb857c14334">csInputBinder</a>.</p>

</div>
</div><p>
<a class="anchor" name="82ea6bef5f334831c251fb455131665a"></a><!-- doxytag: member="iInputBinder::Button" ref="82ea6bef5f334831c251fb455131665a" args="(unsigned cmd)=0" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool iInputBinder::Button           </td>
          <td>(</td>
          <td class="paramtype">unsigned&nbsp;</td>
          <td class="paramname"> <em>cmd</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Returns the status of the given button command. 
<p>

<p>Implemented in <a class="el" href="classcsInputBinder.html#51c93c254f5f5b3bc9006b52a8610d5d">csInputBinder</a>.</p>

</div>
</div><p>
<a class="anchor" name="c6e225b0c0b881ac98ad88d263b576b0"></a><!-- doxytag: member="iInputBinder::LoadConfig" ref="c6e225b0c0b881ac98ad88d263b576b0" args="(iConfigFile *, const char *subsection=0)=0" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual void iInputBinder::LoadConfig           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structiConfigFile.html">iConfigFile</a> *&nbsp;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>subsection</em> = <code>0</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Load bindings from a configuration file. 
<p>

<p>Implemented in <a class="el" href="classcsInputBinder.html#58910c350b567bd011a7e0cdc01a6ea0">csInputBinder</a>.</p>

</div>
</div><p>
<a class="anchor" name="c03ddf7eb4385e967bec294d3a9c4d5c"></a><!-- doxytag: member="iInputBinder::QueryHandler" ref="c03ddf7eb4385e967bec294d3a9c4d5c" args="()=0" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="structiEventHandler.html">iEventHandler</a>* iInputBinder::QueryHandler           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Get a pointer to the embedded iEventHander. 
<p>
<dl class="remark" compact><dt><b>Remarks:</b></dt><dd>This class has to be registered with the event queue: EventQueue-&gt;RegisterListener(InputBinder-&gt;QueryHandler (), CSMASK_Input); to get working <a class="el" href="structiInputBinder.html#f9c22268b61b357eb2982e8e2d163908" title="Returns the position of the given axis command.">Axis()</a> and <a class="el" href="structiInputBinder.html#82ea6bef5f334831c251fb455131665a" title="Returns the status of the given button command.">Button()</a> methods. </dd></dl>

<p>Implemented in <a class="el" href="classcsInputBinder.html#ea9c59b1df9fb94c1b52e98fedb96e36">csInputBinder</a>.</p>

</div>
</div><p>
<a class="anchor" name="2e7ad6cdbc829f380e9ab57b944e334f"></a><!-- doxytag: member="iInputBinder::SaveConfig" ref="2e7ad6cdbc829f380e9ab57b944e334f" args="(iConfigFile *, const char *subsection=0)=0" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual void iInputBinder::SaveConfig           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structiConfigFile.html">iConfigFile</a> *&nbsp;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>subsection</em> = <code>0</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Save bindings to a configuration file. 
<p>

<p>Implemented in <a class="el" href="classcsInputBinder.html#192b715a852fbb3e7d06948a6ce07e48">csInputBinder</a>.</p>

</div>
</div><p>
<a class="anchor" name="2ec10a42410f088450765b7a8eb704f5"></a><!-- doxytag: member="iInputBinder::UnbindAll" ref="2ec10a42410f088450765b7a8eb704f5" args="()=0" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual void iInputBinder::UnbindAll           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Remove all bindings. 
<p>

<p>Implemented in <a class="el" href="classcsInputBinder.html#2f0a8d8467c78d3c87663531beb064a9">csInputBinder</a>.</p>

</div>
</div><p>
<a class="anchor" name="5ade82463225ad4f90f25b7278f11074"></a><!-- doxytag: member="iInputBinder::UnbindAxis" ref="5ade82463225ad4f90f25b7278f11074" args="(unsigned cmd)=0" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool iInputBinder::UnbindAxis           </td>
          <td>(</td>
          <td class="paramtype">unsigned&nbsp;</td>
          <td class="paramname"> <em>cmd</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Remove a binding. 
<p>

<p>Implemented in <a class="el" href="classcsInputBinder.html#95923955df63e1141b51ad3fe3952b6c">csInputBinder</a>.</p>

</div>
</div><p>
<a class="anchor" name="18e8e97320f442b0fdfa60e3b2c051cf"></a><!-- doxytag: member="iInputBinder::UnbindButton" ref="18e8e97320f442b0fdfa60e3b2c051cf" args="(unsigned cmd)=0" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool iInputBinder::UnbindButton           </td>
          <td>(</td>
          <td class="paramtype">unsigned&nbsp;</td>
          <td class="paramname"> <em>cmd</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Remove a binding. 
<p>

<p>Implemented in <a class="el" href="classcsInputBinder.html#b8476dfeef69506278d41aa1fab84686">csInputBinder</a>.</p>

</div>
</div><p>
<hr>The documentation for this struct was generated from the following file:<ul>
<li>iutil/<a class="el" href="iutil_2binder_8h-source.html">binder.h</a></ul>
<hr size="1"><address><small>Generated for Crystal Space 1.2.1 by 
<a href="http://www.doxygen.org/index.html">doxygen</a> 1.5.3 
</small></address> </div></body> </html>