OIS::JoyStick Class Reference

#include <OISJoyStick.h>

Inheritance diagram for OIS::JoyStick:
[legend]
Collaboration diagram for OIS::JoyStick:
[legend]

List of all members.

Public Member Functions

virtual ~JoyStick ()
short buttons ()
short axes ()
short hats ()
virtual void setEventCallback (JoyStickListener *joyListener)
JoyStickListenergetEventCallback ()
const JoyStickStategetJoyStickState () const

Static Public Attributes

static const int MIN_AXIS = -32768
 The minimal axis value.
static const int MAX_AXIS = 32767
 The maximum axis value.

Protected Member Functions

 JoyStick ()

Protected Attributes

short numButtons
short numAxes
short numHats
JoyStickState mState
JoyStickListenerlistener


Detailed Description

Joystick base class. To be implemented by specific system (ie. DirectX joystick) This class is useful as you remain OS independent using this common interface.

Definition at line 132 of file OISJoyStick.h.


Constructor & Destructor Documentation

virtual OIS::JoyStick::~JoyStick (  )  [inline, virtual]

Definition at line 135 of file OISJoyStick.h.

OIS::JoyStick::JoyStick (  )  [inline, protected]

Definition at line 168 of file OISJoyStick.h.


Member Function Documentation

short OIS::JoyStick::buttons (  )  [inline]

Remarks:
Returns the number of buttons

Definition at line 138 of file OISJoyStick.h.

short OIS::JoyStick::axes (  )  [inline]

Remarks:
Returns the number of axes

Definition at line 141 of file OISJoyStick.h.

short OIS::JoyStick::hats (  )  [inline]

Remarks:
Returns the number of hats

Definition at line 144 of file OISJoyStick.h.

virtual void OIS::JoyStick::setEventCallback ( JoyStickListener joyListener  )  [inline, virtual]

Remarks:
Register/unregister a JoyStick Listener - Only one allowed for simplicity. If broadcasting is neccessary, just broadcast from the callback you registered.
Parameters:
joyListener Send a pointer to a class derived from JoyStickListener or 0 to clear the callback

Reimplemented in OIS::LinuxJoyStick.

Definition at line 153 of file OISJoyStick.h.

Referenced by doStartup().

JoyStickListener* OIS::JoyStick::getEventCallback (  )  [inline]

Remarks:
Returns currently set callback.. or null

Definition at line 156 of file OISJoyStick.h.

const JoyStickState& OIS::JoyStick::getJoyStickState (  )  const [inline]

Remarks:
Returns the state of the joystick - is valid for both buffered and non buffered mode

Definition at line 159 of file OISJoyStick.h.

Referenced by handleNonBufferedJoy().


Member Data Documentation

const int OIS::JoyStick::MIN_AXIS = -32768 [static]

The minimal axis value.

Definition at line 162 of file OISJoyStick.h.

Referenced by OIS::LinuxJoyStick::capture(), and OIS::Win32JoyStick::DIEnumDeviceObjectsCallback().

const int OIS::JoyStick::MAX_AXIS = 32767 [static]

The maximum axis value.

Definition at line 165 of file OISJoyStick.h.

Referenced by OIS::LinuxJoyStick::capture(), and OIS::Win32JoyStick::DIEnumDeviceObjectsCallback().

short OIS::JoyStick::numButtons [protected]

Definition at line 170 of file OISJoyStick.h.

Referenced by OIS::Win32JoyStick::_enumerate(), OIS::LinuxJoyStick::_getJoyInfo(), and OIS::LinuxJoyStick::LinuxJoyStick().

short OIS::JoyStick::numAxes [protected]

Definition at line 171 of file OISJoyStick.h.

Referenced by OIS::Win32JoyStick::_enumerate(), OIS::LinuxJoyStick::_getJoyInfo(), and OIS::LinuxJoyStick::LinuxJoyStick().

short OIS::JoyStick::numHats [protected]

Definition at line 172 of file OISJoyStick.h.

Referenced by OIS::LinuxJoyStick::_getJoyInfo(), and OIS::LinuxJoyStick::LinuxJoyStick().

JoyStickState OIS::JoyStick::mState [protected]

Definition at line 174 of file OISJoyStick.h.

Referenced by OIS::Win32JoyStick::_changePOV(), OIS::Win32JoyStick::_doButtonClick(), OIS::Win32JoyStick::_initialize(), OIS::LinuxJoyStick::_initialize(), and OIS::LinuxJoyStick::capture().

JoyStickListener* OIS::JoyStick::listener [protected]

Definition at line 176 of file OISJoyStick.h.

Referenced by OIS::Win32JoyStick::_changePOV(), OIS::Win32JoyStick::_doButtonClick(), OIS::LinuxJoyStick::capture(), OIS::LinuxJoyStick::setEventCallback(), and OIS::Win32JoyStick::Win32JoyStick().


The documentation for this class was generated from the following file:
Generated on Sat Dec 1 20:13:55 2007 for OIS by  doxygen 1.5.4