csInputBinder Class Reference
Use this class to bind input events (keypress, button press, mouse move, etc. More...
#include <csutil/binder.h>
Inherits scfImplementation2<csInputBinder, iInputBinder, iEventHandler>.
Public Member Functions | |
csInputBinder (iObjectRegistry *, iBase *parent=0, int btnSize=127, int axisSize=13) | |
Create a new binder with an initial bindings hash size. |
Detailed Description
Use this class to bind input events (keypress, button press, mouse move, etc.) to commands which are represented by an unsigned integer. It is up to the application to specify the meaning of a command value.
Example:
enum MyCommand = { Walk, Shoot, Jump, LookX, LookY }; ... csRef<iInputBinder> binder = ...; binder->BindButton (csInputDefinition ("ctrl"), Shoot); binder->BindAxis (csInputDefinition ("mousex"), LookX); ... if (binder->Button (Shoot)) ... else { DoSomething (binder->Axis (LookX), binder->Axis (LookY)); }
Definition at line 57 of file binder.h.
Constructor & Destructor Documentation
csInputBinder::csInputBinder | ( | iObjectRegistry * | , | |
iBase * | parent = 0 , |
|||
int | btnSize = 127 , |
|||
int | axisSize = 13 | |||
) |
Create a new binder with an initial bindings hash size.
For optimum hash storage, size should be a prime number.
The documentation for this class was generated from the following file:
- csutil/binder.h
Generated for Crystal Space 1.4.0 by doxygen 1.5.8