diff options
author | Paul Lemire <paul.lemire@kdab.com> | 2016-08-25 16:12:26 +0200 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2016-11-19 11:23:35 +0000 |
commit | af4c8f64a1b47e94827dc34777f6567907162333 (patch) | |
tree | fa71b9b2333c0ab13dba03ad13d02fff2c6649a7 /src/input/frontend/qmousedevice.cpp | |
parent | 5e41169c7a6786d6a78da1efdc5b8755d2d265a8 (diff) |
QMouseDevice: add buttonIdentifier method which was missing
Change-Id: I536a0736d62d71b7cb579dde96a9f70667d35278
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/input/frontend/qmousedevice.cpp')
-rw-r--r-- | src/input/frontend/qmousedevice.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/input/frontend/qmousedevice.cpp b/src/input/frontend/qmousedevice.cpp index 56d3731ce..e7d68b2bc 100644 --- a/src/input/frontend/qmousedevice.cpp +++ b/src/input/frontend/qmousedevice.cpp @@ -40,6 +40,7 @@ #include "qmousedevice.h" #include "qmousedevice_p.h" #include <Qt3DInput/qphysicaldevicecreatedchange.h> +#include <Qt3DInput/qmouseevent.h> #include <Qt3DCore/qentity.h> QT_BEGIN_NAMESPACE @@ -187,6 +188,22 @@ int QMouseDevice::axisIdentifier(const QString &name) const return -1; } +int QMouseDevice::buttonIdentifier(const QString &name) const +{ + if (name == QLatin1String("Left")) + return Qt3DInput::QMouseEvent::LeftButton; + if (name == QLatin1String("Right")) + return Qt3DInput::QMouseEvent::RightButton; + if (name == QLatin1String("Center")) + return Qt3DInput::QMouseEvent::MiddleButton; + return -1; +} + +/*! + \property Qt3DInput::QMouseDevice::sensitivity + + The sensitivity of the device. + */ float QMouseDevice::sensitivity() const { Q_D(const QMouseDevice); |