Main Page | Modules | Class Hierarchy | Data Structures | File List | Data Fields | Globals | Related Pages

omJoystickDriver Class Reference
[DEVICE DRIVER classes of the OpenMAIA Library]

#include <omJoystickDriver.h>

Inheritance diagram for omJoystickDriver:

omObject

Public Member Functions

 omJoystickDriver (omObject *, int, int, float, float, float, float, bool)
bool GetError ()
void Start ()
void Stop ()
void EnableAllButtons ()
void DisableAllButtons ()

Private Member Functions

void Notify ()
 Timer notify.


Private Attributes

int tickTime
 Pool time.

int sxThreshold
 Runtime threshold.

int dxThreshold
 Runtime threshold.

int upThreshold
 Runtime threshold.

int downThreshold
 Runtime threshold.

omObjecttoInform
 Object to inform.

bool actionOnPress
 Flag.

wxJoystick * joy
 joy object

bool joystickConnected
 not(ErrorState)

bool isSx
 Flag.

bool isDx
 Flag.

bool isUp
 Flag.

bool isDown
 Flag.

bool isButton
 Flag.

bool allButtonsEnabled
 Flag.

int buttonMask
 Button mask for GetButtonState().


Detailed Description

OpenMAIA Joystick driver.

This class is used as a driver for joystick events.
The position of the joystick cloche is rapresented by two integer values. X axis position is rapresented by a value that is 0 when the joystick is to the far left and is set to max when the joystick is to the far right.
Y axis position is rapresented by a value that is 0 when the joystick is in the forward position and is set to max when the joystick is in the backward position.
In the constructor of the class you specify the percentage of the axis that is considerated as left, as right, as up and as down.

This class generates events to object specified in the constructor.


Constructor & Destructor Documentation

omJoystickDriver::omJoystickDriver omObject object,
int  tick,
int  jn,
float  lp,
float  rp,
float  up,
float  dp,
bool  onpress
 

Initialize the class.
By default Action event is generated by fire button of the joystick.

Parameters:
object Object to inform if event occoured.
tick Pooling period in milliseconds.
jn Joystick Number, maybe wxJOYSTICK1 or wxJOYSTICK2.
lp Left percentage, usually 2/10.
rp Right percentage, usually 8/10.
up Up percentage, usually 2/10.
dp Down percentage, usually 8/10.
onpress Flag that specify if the action must be taken on the pression or on the releas of the button key


Member Function Documentation

void omJoystickDriver::DisableAllButtons  ) 
 

Disable Action event sending when one of button 1,2 or 3 is pressed.
Action event is sent only on button 1 pression.

void omJoystickDriver::EnableAllButtons  ) 
 

Enable Action event sending when one of button 1,2 or 3 is pressed.

bool omJoystickDriver::GetError  ) 
 

Return error state.
If the function return true means that joystick was not found and don't work correctly

Returns:
Error state.

void omJoystickDriver::Notify  )  [private]
 

Timer notify.

void omJoystickDriver::Start  )  [virtual]
 

Start pooling joystick status

Reimplemented from omObject.

void omJoystickDriver::Stop  )  [virtual]
 

Stop pooling joystick status

Reimplemented from omObject.


Field Documentation

bool omJoystickDriver::actionOnPress [private]
 

Flag.

bool omJoystickDriver::allButtonsEnabled [private]
 

Flag.

int omJoystickDriver::buttonMask [private]
 

Button mask for GetButtonState().

int omJoystickDriver::downThreshold [private]
 

Runtime threshold.

int omJoystickDriver::dxThreshold [private]
 

Runtime threshold.

bool omJoystickDriver::isButton [private]
 

Flag.

bool omJoystickDriver::isDown [private]
 

Flag.

bool omJoystickDriver::isDx [private]
 

Flag.

bool omJoystickDriver::isSx [private]
 

Flag.

bool omJoystickDriver::isUp [private]
 

Flag.

wxJoystick* omJoystickDriver::joy [private]
 

joy object

bool omJoystickDriver::joystickConnected [private]
 

not(ErrorState)

int omJoystickDriver::sxThreshold [private]
 

Runtime threshold.

int omJoystickDriver::tickTime [private]
 

Pool time.

omObject* omJoystickDriver::toInform [private]
 

Object to inform.

int omJoystickDriver::upThreshold [private]
 

Runtime threshold.


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