summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire@kdab.com>2016-07-12 10:31:59 +0200
committerPaul Lemire <paul.lemire@kdab.com>2016-09-08 06:44:07 +0000
commitde16b5d1409300351f98c4aa8c7103f3c6b8eaba (patch)
treed4b8d4731c3045d930a51ec1d0e5c0a58ec4dbc7 /src
parent40c81d3dcfebff613222a877bef2d0a3312f4adc (diff)
downloadqt3d-de16b5d1409300351f98c4aa8c7103f3c6b8eaba.tar.gz
Add Wheel axes to QMouseDevice
Change-Id: Ie56e95cfe388e5297e41d181fc6dbbd25ac81171 Task-number: QTBUG-54620 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/input/frontend/qmousedevice.cpp15
-rw-r--r--src/input/frontend/qmousedevice.h4
2 files changed, 14 insertions, 5 deletions
diff --git a/src/input/frontend/qmousedevice.cpp b/src/input/frontend/qmousedevice.cpp
index d0ae0317d..d5cdc9478 100644
--- a/src/input/frontend/qmousedevice.cpp
+++ b/src/input/frontend/qmousedevice.cpp
@@ -83,6 +83,8 @@ QMouseDevicePrivate::QMouseDevicePrivate()
\value X
\value Y
+ \value WheelX
+ \value WheelY
\sa Qt3DInput::QAnalogAxisInput::setAxis
*/
@@ -103,12 +105,11 @@ QMouseDevice::~QMouseDevice()
/*!
\return the axis count.
- \note Currently always returns 2.
+ \note Currently always returns 4.
*/
int QMouseDevice::axisCount() const
{
- // TO DO: we could have mouse wheel later on
- return 2;
+ return 4;
}
/*!
@@ -130,7 +131,9 @@ QStringList QMouseDevice::axisNames() const
{
return QStringList()
<< QStringLiteral("X")
- << QStringLiteral("Y");
+ << QStringLiteral("Y")
+ << QStringLiteral("WheelX")
+ << QStringLiteral("WheelY");
}
/*!
@@ -155,6 +158,10 @@ int QMouseDevice::axisIdentifier(const QString &name) const
return X;
else if (name == QLatin1String("Y"))
return Y;
+ else if (name == QLatin1String("WheelX"))
+ return WheelX;
+ else if (name == QLatin1String("WheelY"))
+ return WheelY;
return -1;
}
diff --git a/src/input/frontend/qmousedevice.h b/src/input/frontend/qmousedevice.h
index fe43c6c84..7a1f6332a 100644
--- a/src/input/frontend/qmousedevice.h
+++ b/src/input/frontend/qmousedevice.h
@@ -63,7 +63,9 @@ public:
enum Axis {
X,
- Y
+ Y,
+ WheelX,
+ WheelY
};
Q_ENUM(Axis)