The PointingDevice class is used to represent Pointing Devices connected to the computer or pseudo-devices.
More...
#include <PointingDevice.h>
|
virtual bool | isActive (void) const |
| Indicates whether the current device is active. More...
|
|
virtual int | getVendorID (void) const |
| Vendor identifier number. More...
|
|
virtual std::string | getVendor (void) const |
| Readable vendor name. More...
|
|
virtual int | getProductID (void) const |
| Product identifier number. More...
|
|
virtual std::string | getProduct (void) const |
| Readable product name. More...
|
|
virtual double | getResolution (double *defval=0) const =0 |
| Resolution of the mouse in CPI (counts per inch). More...
|
|
virtual double | getUpdateFrequency (double *defval=0) const =0 |
| Update frequency of the mouse in Hz. More...
|
|
virtual URI | getURI (bool expanded=false, bool crossplatform=false) const =0 |
| Constructs the URI according to the parameters of the device. More...
|
|
virtual void | setPointingCallback (PointingCallback callback, void *context=0)=0 |
| Sets the callback function which is called when device events occur. More...
|
|
virtual void | setDebugLevel (int) |
| Sets the level of information for debugging purposes (default = 0).
|
|
virtual void | debug (std::ostream &) const |
| Outputs the debug information to the given output stream.
|
|
virtual void | getAbsolutePosition (double *x, double *y) const |
| getAbsolutePosition Returns absolute position of the device if available otherwise -1, -1 More...
|
|
|
int | mm2counts (double millimeters) const |
|
double | counts2mm (int counts) const |
|
int | in2counts (double inches) const |
|
double | counts2in (int counts) const |
|
|
static void | idle (int milliseconds) |
| The function is used to sleep the current thread. More...
|
|
|
static PointingDevice * | create (const char *device_uri=0) |
| This static function is used to instantiate a platform-specific object of the class. More...
|
|
static PointingDevice * | create (std::string device_uri) |
|
|
void | registerTimestamp (TimeStamp::inttime timestamp, int dx, int dy) |
| registerTimestamp Registers the current timestamp to calculate frequency of the device
|
|
double | estimatedUpdateFrequency () const |
| estimatedUpdateFrequency Estimates the frequency depending on the input timestamps More...
|
|
|
FrequencyEstimator | freqEstim |
|
The PointingDevice class is used to represent Pointing Devices connected to the computer or pseudo-devices.
It is an abstract class which creates an instance using create factory method.
typedef void(* pointing::PointingDevice::PointingCallback)(void *context, TimeStamp::inttime timestamp, int dx, int dy, int buttons) |
This signature is used when a callback function is created for the Pointing Device. The callback function is called whenever the device is moved or its buttons are pressed.
- Parameters
-
dx | Horizontal translation of the device |
dy | Vertical tranlation of the device |
buttons | The state of the buttons (from 0 to 7) |
The enumeration of mouse buttons
Enumerator |
---|
BUTTON_1 |
Left mouse button
|
BUTTON_2 |
Middle mouse button
|
BUTTON_3 |
Right mouse button
|
PointingDevice * pointing::PointingDevice::create |
( |
const char * |
device_uri = 0 | ) |
|
|
static |
This static function is used to instantiate a platform-specific object of the class.
- Parameters
-
device_uri | is used to initialize the Device with given parameters. If not given, any supported device is chosen. |
- Returns
- PointingDevice instance with specified parameters.
double pointing::PointingDevice::estimatedUpdateFrequency |
( |
| ) |
const |
|
protected |
estimatedUpdateFrequency Estimates the frequency depending on the input timestamps
- Returns
- 125, 250, 500, 1000 or -1
void pointing::PointingDevice::getAbsolutePosition |
( |
double * |
x, |
|
|
double * |
y |
|
) |
| const |
|
virtual |
getAbsolutePosition Returns absolute position of the device if available otherwise -1, -1
- Parameters
-
Reimplemented in pointing::winPointingDevice.
virtual std::string pointing::PointingDevice::getProduct |
( |
void |
| ) |
const |
|
inlinevirtual |
virtual int pointing::PointingDevice::getProductID |
( |
void |
| ) |
const |
|
inlinevirtual |
virtual double pointing::PointingDevice::getResolution |
( |
double * |
defval = 0 | ) |
const |
|
pure virtual |
virtual double pointing::PointingDevice::getUpdateFrequency |
( |
double * |
defval = 0 | ) |
const |
|
pure virtual |
virtual URI pointing::PointingDevice::getURI |
( |
bool |
expanded = false , |
|
|
bool |
crossplatform = false |
|
) |
| const |
|
pure virtual |
virtual std::string pointing::PointingDevice::getVendor |
( |
void |
| ) |
const |
|
inlinevirtual |
virtual int pointing::PointingDevice::getVendorID |
( |
void |
| ) |
const |
|
inlinevirtual |
void pointing::PointingDevice::idle |
( |
int |
milliseconds | ) |
|
|
static |
The function is used to sleep the current thread.
- Parameters
-
milliseconds | Sleep time of the main thread in milliseconds |
virtual bool pointing::PointingDevice::isActive |
( |
void |
| ) |
const |
|
inlinevirtual |
int pointing::PointingDevice::mm2counts |
( |
double |
millimeters | ) |
const |
Not implemented in the current version
virtual void pointing::PointingDevice::setPointingCallback |
( |
PointingCallback |
callback, |
|
|
void * |
context = 0 |
|
) |
| |
|
pure virtual |
The documentation for this class was generated from the following files: