00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef INPUTDEVICE_H
00020 #define INPUTDEVICE_H
00021
00022 #include "inputthread.h"
00023 #include "gluondevices.h"
00024
00025 #include <QtCore/QMap>
00026 #include <QtCore/QPair>
00027 #include <QtCore/QPoint>
00028 #include <QtCore/QThread>
00029 #include <QtCore/QEvent>
00030 #include <QtCore/QSharedData>
00031 #include <QtCore/QObject>
00032
00033 namespace GluonInput
00034 {
00035 class InputDevicePrivate;
00036
00037 class GLUON_INPUT_EXPORT InputDevice : public QObject
00038 {
00039 Q_OBJECT
00040 Q_ENUMS( GluonInput::KeyboardButton )
00041
00042 public:
00043 InputDevice();
00044 explicit InputDevice( InputThread* inputThread, QObject* parent = 0 );
00045 ~InputDevice();
00046
00047 int vendor() const;
00048 int product() const;
00049 int version() const;
00050 int bustype() const;
00051
00052 const QString deviceName() const;
00053 GluonInput::DeviceFlag deviceType()const;
00054
00055 QList<int> buttonCapabilities() const;
00056 QList<int> absAxisCapabilities() const;
00057 QList<int> relAxisCapabilities() const;
00058 AbsVal axisInfo( int axisCode ) const;
00059 bool buttonPressed( int code ) const;
00060 QString buttonName( int code ) const;
00061 QString axisName( int code ) const;
00062
00063 bool error() const;
00064 QString msgError() const;
00065
00066 void setInputThread( InputThread* inputThread );
00067 InputThread* inputThread() const;
00068
00069 bool isEnabled() const;
00070 void setEnabled( bool enable );
00071
00072 private slots:
00073 void buttonStateChanged( int code, int value );
00074
00075 private:
00076
00077 QSharedDataPointer<InputDevicePrivate> d;
00078 };
00079 }
00080 #endif // KCLINPUT_H