![]() |
Public API Reference |
![]() |
SCF interface for csInputBinder, used to bind input events (keypress, button press, mouse move, etc.) to commands which are represented by an unsigned integer. More...
#include <iutil/binder.h>
Public Member Functions | |
virtual int | Axis (unsigned cmd)=0 |
Returns the position of the given axis command. | |
virtual void | BindAxis (csInputDefinition const &def, unsigned int cmd, int sensitivity=1)=0 |
Bind an axis motion event to an axis command. | |
virtual void | BindButton (csInputDefinition const &def, unsigned int cmd, bool toggle=false)=0 |
Bind a button event to a button command. | |
virtual bool | Button (unsigned cmd)=0 |
Returns the status of the given button command. | |
virtual void | LoadConfig (iConfigFile *, const char *subsection=0)=0 |
Load bindings from a configuration file. | |
virtual iEventHandler * | QueryHandler ()=0 |
Get a pointer to the embedded iEventHander. | |
virtual void | SaveConfig (iConfigFile *, const char *subsection=0)=0 |
Save bindings to a configuration file. | |
virtual void | UnbindAll ()=0 |
Remove all bindings. | |
virtual bool | UnbindAxis (unsigned cmd)=0 |
Remove a binding. | |
virtual bool | UnbindButton (unsigned cmd)=0 |
Remove a binding. |
SCF interface for csInputBinder, used 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)); }
virtual int iInputBinder::Axis | ( | unsigned | cmd | ) | [pure virtual] |
Returns the position of the given axis command.
Implemented in csInputBinder.
virtual void iInputBinder::BindAxis | ( | csInputDefinition const & | def, |
unsigned int | cmd, | ||
int | sensitivity = 1 |
||
) | [pure virtual] |
Bind an axis motion event to an axis command.
def | Describes the physical axis to bind to. |
cmd | The ID of the command to bind. |
sensitivity | A multiplier for the axis command. |
Implemented in csInputBinder.
virtual void iInputBinder::BindButton | ( | csInputDefinition const & | def, |
unsigned int | cmd, | ||
bool | toggle = false |
||
) | [pure virtual] |
Bind a button event to a button command.
def | Describes the physical button to bind to. |
cmd | The ID of the command to bind. |
toggle | If true, button status is only toggled on keydown events. |
Implemented in csInputBinder.
virtual bool iInputBinder::Button | ( | unsigned | cmd | ) | [pure virtual] |
Returns the status of the given button command.
Implemented in csInputBinder.
virtual void iInputBinder::LoadConfig | ( | iConfigFile * | , |
const char * | subsection = 0 |
||
) | [pure virtual] |
Load bindings from a configuration file.
Implemented in csInputBinder.
virtual iEventHandler* iInputBinder::QueryHandler | ( | ) | [pure virtual] |
Get a pointer to the embedded iEventHander.
Implemented in csInputBinder.
virtual void iInputBinder::SaveConfig | ( | iConfigFile * | , |
const char * | subsection = 0 |
||
) | [pure virtual] |
Save bindings to a configuration file.
Implemented in csInputBinder.
virtual void iInputBinder::UnbindAll | ( | ) | [pure virtual] |
Remove all bindings.
Implemented in csInputBinder.
virtual bool iInputBinder::UnbindAxis | ( | unsigned | cmd | ) | [pure virtual] |
Remove a binding.
Implemented in csInputBinder.
virtual bool iInputBinder::UnbindButton | ( | unsigned | cmd | ) | [pure virtual] |
Remove a binding.
Implemented in csInputBinder.