Classes | Namespaces | Enumerations | Functions

source-device.h File Reference

#include "common/common.h"
#include "threadsafe/smart_ptr.h"
Include dependency graph for source-device.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  gamepad::pot_value_t
 what you get back when you read the value of a particular potentiometer More...
class  gamepad::SourceDevice
 An object that supplies gamepad input. More...
class  gamepad::SourceDeviceFactory
 objects supporting this interface can create gamepad::SourceDevice instances. More...
struct  gamepad::device_state_t
 state snapshot of a source device. Used by configuration tools only More...

Namespaces

namespace  gamepad

Enumerations

enum  gamepad::eButton {
  gamepad::eButtonDown = 0x01,
  gamepad::eButtonUp = 0x00,
  gamepad::eButtonWasPushed = 0x10,
  gamepad::eButtonWasReleased = 0x20,
  gamepad::eButtonWasOrIsDown = 0x11,
  gamepad::eButtonInvalid = 0x80
}
 

button state enum.

More...
enum  gamepad::eDeviceState {
  gamepad::eDevice_Attached = 0x0001,
  gamepad::eDevice_Detached = 0x0002,
  gamepad::eDevice_Unknown = 0x0004,
  gamepad::eDevice_Invalid = 0
}
 

device state enum.

More...

Functions

byte_t gamepad::updateButton (IN byte_t oldBitFlags, IN bool isButtonDown) throw ()
 helper method to update a button value.
void gamepad::snapshotState (IN SourceDevice *device, OUT device_state_t &state)
 take a state snapshot
int gamepad::buttonDown (IN const device_state_t &state)
 is a single button down?
int gamepad::buttonReleased (IN const device_state_t &state)
 was a button released?
int gamepad::buttonChanged (IN const device_state_t &oldState, IN const device_state_t &newState)
 compare new and old states: did a single button change state?
bool gamepad::potsCalibrated (IN const device_state_t &oldState, IN const device_state_t &newState)
 compare new and old states: are all potentiometers calibrated?
int gamepad::maxPotValue (IN const device_state_t &state, IN float threshold)
 get pot at largest value--specify threshold: 0 (min) to 1 (max).
int gamepad::maxPotChanged (IN const device_state_t &oldState, IN const device_state_t &newState)
 compare new and old states: which potentiometer has changed most?