00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include "inputthread.h"
00023 #include "absval.h"
00024
00025 #include <QtCore/QMap>
00026
00027 using namespace GluonInput;
00028
00029 class InputThread::InputThreadPrivate
00030 {
00031 public:
00032 int vendor;
00033 int product;
00034 int version;
00035 int bustype;
00036
00037 QString deviceName;
00038 QString msgError;
00039
00040 bool error;
00041
00042 GluonInput::DeviceFlag deviceType;
00043
00044 QList<int> buttonCapabilities;
00045 QList<int> relAxisCapabilities;
00046 QList<int> absAxisCapabilities;
00047 QMap<int, AbsVal> absAxisInfos;
00048 };
00049
00050 InputThread::InputThread( const QString& devicePath, QObject* parent )
00051 : QThread( parent )
00052 , d( new InputThreadPrivate )
00053 {
00054 }
00055
00056 InputThread::~InputThread()
00057 {
00058 }
00059
00060 void InputThread::run()
00061 {
00062 }
00063
00064 int InputThread::joystickXAxis()
00065 {
00066 return 0;
00067 }
00068
00069 int InputThread::joystickYAxis()
00070 {
00071 return 0;
00072 }
00073
00074 int InputThread::joystickZAxis()
00075 {
00076 return 0;
00077 }
00078
00079 void InputThread::stop()
00080 {
00081 quit();
00082 }
00083
00084 int InputThread::vendor() const
00085 {
00086 return d->vendor;
00087 }
00088
00089 int InputThread::product() const
00090 {
00091 return d->product;
00092 }
00093
00094 int InputThread::version() const
00095 {
00096 return d->version;
00097 }
00098
00099 int InputThread::bustype() const
00100 {
00101 return d->bustype;
00102 }
00103
00104 QList<int> InputThread::buttonCapabilities() const
00105 {
00106 return d->buttonCapabilities;
00107 }
00108
00109 QList<int> InputThread::absAxisCapabilities() const
00110 {
00111 return d->absAxisCapabilities;
00112 }
00113
00114 QList<int> InputThread::relAxisCapabilities() const
00115 {
00116 return d->relAxisCapabilities;
00117 }
00118
00119 AbsVal InputThread::axisInfo( int axisCode ) const
00120 {
00121 return d->absAxisInfos[axisCode];
00122 }
00123
00124 const QString InputThread::deviceName() const
00125 {
00126 return d->deviceName;
00127 }
00128
00129 GluonInput::DeviceFlag InputThread::deviceType() const
00130 {
00131 return d->deviceType;
00132 }
00133
00134 bool InputThread::isEnabled() const
00135 {
00136 return this->isRunning();
00137 }
00138
00139 bool InputThread::error()
00140 {
00141 return d->error;
00142 }
00143
00144 QString InputThread::msgError()
00145 {
00146 return d->msgError;
00147 }