CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

csInputBinder Class Reference

Bind an input event to a pointer to a variable so that that variable will reflect the state of a given key, button or axis. More...

#include <binder.h>

Inheritance diagram for csInputBinder:

iInputBinder iBase List of all members.

Public Methods

 csInputBinder (iBase *parent=0, int size=127)
 Create a new binder with an initial bindings hash size. More...

virtual ~csInputBinder ()
 Destructor invokes UnbindAll() automatically. More...

virtual iEventHandlerQueryHandler ()
 Get a pointer to the embedded event handler. More...

virtual void Bind (iEvent &, iInputBinderBoolean *, bool toggle=false)
 Bind a bool to a keyboard key or mouse or joystick button status. More...

virtual void Bind (iEvent &, iInputBinderPosition *)
 Bind two integers to the x and y axes of a mouse or joystick. More...

virtual bool Unbind (iEvent &)
 Remove a binding. More...

virtual bool UnbindAll ()
 Remove all bindings. More...


Detailed Description

Bind an input event to a pointer to a variable so that that variable will reflect the state of a given key, button or axis.

Definition at line 36 of file csutil/binder.h.


Constructor & Destructor Documentation

csInputBinder::csInputBinder iBase   parent = 0,
int    size = 127
 

Create a new binder with an initial bindings hash size.

For optimum hash storage, size should be a prime number.

virtual csInputBinder::~csInputBinder   [virtual]
 

Destructor invokes UnbindAll() automatically.


Member Function Documentation

virtual void csInputBinder::Bind iEvent  ,
iInputBinderPosition  
[virtual]
 

Bind two integers to the x and y axes of a mouse or joystick.

Implements iInputBinder.

virtual void csInputBinder::Bind iEvent  ,
iInputBinderBoolean  ,
bool    toggle = false
[virtual]
 

Bind a bool to a keyboard key or mouse or joystick button status.

If toggle is true, one press activates and the second deactivates. Otherwise, keydown activates and keyup deactivates.

Implements iInputBinder.

virtual iEventHandler* csInputBinder::QueryHandler   [inline, virtual]
 

Get a pointer to the embedded event handler.

This class can be registered with the event queue: iEventQueue::RegisterListener(this, CSMASK_Input);

Implements iInputBinder.

Definition at line 70 of file csutil/binder.h.

virtual bool csInputBinder::Unbind iEvent   [virtual]
 

Remove a binding.

Implements iInputBinder.

virtual bool csInputBinder::UnbindAll   [virtual]
 

Remove all bindings.

Implements iInputBinder.


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.2.14