csInputBinder Class Reference
Use this class to bind input events (keypress, button press, mouse move, etc. More...
#include <csutil/binder.h>
Inheritance diagram for csInputBinder:

Public Member Functions | |
virtual int | Axis (unsigned cmd) |
Returns the position of the given axis command. | |
virtual void | BindAxis (csInputDefinition const &def, unsigned int cmd, int sensitivity=1) |
Bind an axis motion event to an axis command. | |
virtual void | BindButton (csInputDefinition const &def, unsigned int cmd, bool toggle=false) |
Bind a button event to a button command. | |
virtual bool | Button (unsigned cmd) |
Returns the status of the given button command. | |
csInputBinder (iBase *parent=0, int btnSize=127, int axisSize=13) | |
Create a new binder with an initial bindings hash size. | |
virtual void | LoadConfig (iConfigFile *, const char *subsection) |
Load bindings from a configuration file. | |
virtual iEventHandler * | QueryHandler () |
Get a pointer to the embedded iEventHander. | |
virtual void | SaveConfig (iConfigFile *, const char *subsection) |
Save bindings to a configuration file. | |
virtual void | UnbindAll () |
Remove all bindings. | |
virtual bool | UnbindAxis (unsigned cmd) |
Remove a binding. | |
virtual bool | UnbindButton (unsigned cmd) |
Remove a binding. | |
Public Attributes | |
SCF_DECLARE_IBASE | |
Friends | |
struct | eiEventHandler |
Classes | |
struct | eiEventHandler |
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 52 of file binder.h.
Constructor & Destructor Documentation
|
Create a new binder with an initial bindings hash size. For optimum hash storage, size should be a prime number. |
Member Function Documentation
|
Returns the position of the given axis command.
Implements iInputBinder. |
|
Bind an axis motion event to an axis command.
Implements iInputBinder. |
|
Bind a button event to a button command.
Implements iInputBinder. |
|
Returns the status of the given button command.
Implements iInputBinder. |
|
Load bindings from a configuration file.
Implements iInputBinder. |
|
Get a pointer to the embedded iEventHander.
Implements iInputBinder. |
|
Save bindings to a configuration file.
Implements iInputBinder. |
|
Remove all bindings.
Implements iInputBinder. |
|
Remove a binding.
Implements iInputBinder. |
|
Remove a binding.
Implements iInputBinder. |
The documentation for this class was generated from the following file:
- csutil/binder.h
Generated for Crystal Space by doxygen 1.4.4