CrystalSpace

Public API Reference

Public Member Functions | Protected Member Functions | Protected Attributes
csMouseDriver Class Reference

Generic Mouse Driver. More...

#include <csutil/csinput.h>

Inheritance diagram for csMouseDriver:
csInputDriver scfImplementation2< csMouseDriver, iMouseDriver, iEventHandler > scfImplementation< csMouseDriver > iMouseDriver iEventHandler iBase scfImplementationHelper CS::Memory::CustomAllocated iBase iBase

List of all members.

Public Member Functions

 csMouseDriver (iObjectRegistry *)
 Initialize mouse interface.
virtual void DoButton (uint number, int button, bool down, const int32 *axes, uint numAxes)
 Call this to add a 'mouse button down/up' event to queue.
virtual void DoMotion (uint number, const int32 *axes, uint numAxes)
 Call this to add a 'mouse moved' event to queue.
virtual int GetLast (uint n, uint axis) const
 Query last mouse position on axis (0, 1, 2, ...) for mouse n (0, 1, 2, ...)
virtual const int32 * GetLast (uint n) const
 Query last mouse axis array for mouse n (0, 1, 2, ...)
virtual bool GetLastButton (int button) const
 Query the last known mouse button state for mouse #0.
virtual bool GetLastButton (uint number, int button) const
 Query the last known mouse button state.
virtual int GetLastX (uint n) const
 Query last mouse X position for mouse #n (0, 1, 2, ...)
virtual int GetLastY (uint n) const
 Query last mouse Y position for mouse #n (0, 1, 2, ...)
virtual void LostFocus ()
 Application lost focus.
virtual void Reset ()
 Call to release all mouse buttons.
CS_EVENTHANDLER_NIL_GENERIC_CONSTRAINTS
virtual
CS_EVENTHANDLER_DEFAULT_INSTANCE_CONSTRAINTS
void 
SetDoubleClickTime (int iTime, size_t iDist)
 Set double-click mouse parameters.
virtual ~csMouseDriver ()
 Destructor.

Protected Member Functions

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

Protected Attributes

bool Button [CS_MAX_MOUSE_COUNT][CS_MAX_MOUSE_BUTTONS]
 Mouse buttons state.
size_t DoubleClickDist
 Mouse double click max distance.
csTicks DoubleClickTime
 Mouse double click max interval in 1/1000 seconds.
int32 Last [CS_MAX_MOUSE_COUNT][CS_MAX_MOUSE_AXES]
 Last mouse positions.
int LastClick [CS_MAX_MOUSE_COUNT][CS_MAX_MOUSE_AXES]
 Last "mouse down" event position.
int LastClickButton [CS_MAX_MOUSE_COUNT]
 Last "mouse down" event button.
csTicks LastClickTime [CS_MAX_MOUSE_COUNT]
 Last "mouse down" event time.

Detailed Description

Generic Mouse Driver.

Mouse driver should generate events and put them into the event queue. Also it is responsible for generating double-click events. Mouse button numbers are 0-based.

Todo:
The csMouseDriver and csJoystickDriver should be unified, since there's no real distinction between them under the hood.

Definition at line 204 of file csinput.h.


Constructor & Destructor Documentation

Initialize mouse interface.

virtual csMouseDriver::~csMouseDriver ( ) [virtual]

Destructor.


Member Function Documentation

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

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

Implements iMouseDriver.

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

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

Implements iMouseDriver.

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

virtual int csMouseDriver::GetLast ( uint  n,
uint  axis 
) const [inline, virtual]

Query last mouse position on axis (0, 1, 2, ...) for mouse n (0, 1, 2, ...)

Implements iMouseDriver.

Definition at line 257 of file csinput.h.

virtual const int32* csMouseDriver::GetLast ( uint  n) const [inline, virtual]

Query last mouse axis array for mouse n (0, 1, 2, ...)

Implements iMouseDriver.

Definition at line 260 of file csinput.h.

virtual bool csMouseDriver::GetLastButton ( int  button) const [inline, virtual]

Query the last known mouse button state for mouse #0.

Implements iMouseDriver.

Definition at line 263 of file csinput.h.

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

Query the last known mouse button state.

Implements iMouseDriver.

Definition at line 266 of file csinput.h.

virtual int csMouseDriver::GetLastX ( uint  n) const [inline, virtual]

Query last mouse X position for mouse #n (0, 1, 2, ...)

Implements iMouseDriver.

Definition at line 253 of file csinput.h.

virtual int csMouseDriver::GetLastY ( uint  n) const [inline, virtual]

Query last mouse Y position for mouse #n (0, 1, 2, ...)

Implements iMouseDriver.

Definition at line 255 of file csinput.h.

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

Application lost focus.

Implements csInputDriver.

Definition at line 288 of file csinput.h.

virtual void csMouseDriver::Reset ( ) [virtual]

Call to release all mouse buttons.

Implements iMouseDriver.

Set double-click mouse parameters.

Implements iMouseDriver.


Member Data Documentation

Mouse buttons state.

Todo:
Change this to a bitmask.

Definition at line 229 of file csinput.h.

size_t csMouseDriver::DoubleClickDist [protected]

Mouse double click max distance.

Definition at line 233 of file csinput.h.

Mouse double click max interval in 1/1000 seconds.

Definition at line 231 of file csinput.h.

Last mouse positions.

Definition at line 223 of file csinput.h.

Last "mouse down" event position.

Definition at line 221 of file csinput.h.

Last "mouse down" event button.

Definition at line 219 of file csinput.h.

Last "mouse down" event time.

Definition at line 217 of file csinput.h.


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

Generated for Crystal Space 2.0 by doxygen 1.7.6.1