CrystalSpace

Public API Reference

csJoystickDriver Class Reference

Generic Joystick driver. More...

#include <csutil/csinput.h>

Inheritance diagram for csJoystickDriver:

List of all members.

Public Member Functions

 csJoystickDriver (iObjectRegistry *)
 Initialize joystick interface.
virtual void DoButton (uint number, int button, bool down, const int32 *axes, uint numAxes)
 Call this to add a 'joystick button down/up' event to queue.
virtual void DoMotion (uint number, const int32 *axes, uint numAxes)
 Call this to add a 'joystick moved' event to queue.
virtual int GetLast (uint number, uint axis) const
 Query last position on 'axis' of joystick 'number'.
virtual const int32 * GetLast (uint number) const
 Query last position on all axes of joystick 'number'.
virtual bool GetLastButton (uint number, int button) const
 Query the last known joystick button state.
virtual void LostFocus ()
 Application lost focus.
virtual
CS_EVENTHANDLER_NIL_CONSTRAINTS
void 
Reset ()
 Call to release all joystick buttons.
virtual ~csJoystickDriver ()
 Destructor.

Protected Member Functions

iKeyboardDriverGetKeyboardDriver ()
 Get the generic keyboard driver (for checking modifier states).

Protected Attributes

bool Button [CS_MAX_JOYSTICK_COUNT][CS_MAX_JOYSTICK_BUTTONS]
 Joystick button states.
int32 Last [CS_MAX_JOYSTICK_COUNT][CS_MAX_JOYSTICK_AXES]
 Joystick axis positions.

Detailed Description

Generic Joystick driver.

The joystick driver is responsible for tracking current joystick state and also for generating joystick events. Joystick numbers and button numbers are 0-based.

Definition at line 301 of file csinput.h.


Constructor & Destructor Documentation

csJoystickDriver::csJoystickDriver ( iObjectRegistry  ) 

Initialize joystick interface.

virtual csJoystickDriver::~csJoystickDriver (  )  [virtual]

Destructor.


Member Function Documentation

virtual void csJoystickDriver::DoButton ( uint  number,
int  button,
bool  down,
const int32 *  axes,
uint  numAxes 
) [virtual]

Call this to add a 'joystick button down/up' event to queue.

Implements iJoystickDriver.

virtual void csJoystickDriver::DoMotion ( uint  number,
const int32 *  axes,
uint  numAxes 
) [virtual]

Call this to add a 'joystick moved' event to queue.

Implements iJoystickDriver.

iKeyboardDriver* csJoystickDriver::GetKeyboardDriver (  )  [protected]

Get the generic keyboard driver (for checking modifier states).

virtual int csJoystickDriver::GetLast ( uint  number,
uint  axis 
) const [inline, virtual]

Query last position on 'axis' of joystick 'number'.

Implements iJoystickDriver.

Definition at line 338 of file csinput.h.

virtual const int32* csJoystickDriver::GetLast ( uint  number  )  const [inline, virtual]

Query last position on all axes of joystick 'number'.

Implements iJoystickDriver.

Definition at line 336 of file csinput.h.

virtual bool csJoystickDriver::GetLastButton ( uint  number,
int  button 
) const [inline, virtual]

Query the last known joystick button state.

Implements iJoystickDriver.

Definition at line 341 of file csinput.h.

virtual void csJoystickDriver::LostFocus (  )  [inline, virtual]

Application lost focus.

Implements csInputDriver.

Definition at line 355 of file csinput.h.

virtual CS_EVENTHANDLER_NIL_CONSTRAINTS void csJoystickDriver::Reset (  )  [virtual]

Call to release all joystick buttons.

Implements iJoystickDriver.


Member Data Documentation

bool csJoystickDriver::Button[CS_MAX_JOYSTICK_COUNT][CS_MAX_JOYSTICK_BUTTONS] [protected]

Joystick button states.

Todo:
Change this to a bitmask

Definition at line 313 of file csinput.h.

int32 csJoystickDriver::Last[CS_MAX_JOYSTICK_COUNT][CS_MAX_JOYSTICK_AXES] [protected]

Joystick axis positions.

Definition at line 315 of file csinput.h.


The documentation for this class was generated from the following file:

Generated for Crystal Space 2.1 by doxygen 1.6.1