summaryrefslogtreecommitdiffstats
path: root/src/input/backend/updateaxisactionjob.cpp
diff options
context:
space:
mode:
authorColin Ogilvie <colin.ogilvie@kdab.com>2016-02-04 17:35:54 +0000
committerSean Harmer <sean.harmer@kdab.com>2016-05-12 09:39:51 +0000
commitc3e628f334b54a883ae5d5f83630855bd0f052d0 (patch)
tree5da059d969d9c6b53fcc98160bc6951ac6cb2b5c /src/input/backend/updateaxisactionjob.cpp
parentfaf56f50608f9391d2a73ed7c61bfdd9c2afab78 (diff)
Linear scaling for key controlled axis
Change-Id: I429fc512a836d569a55f0ac6490d020f1e8c2808 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/input/backend/updateaxisactionjob.cpp')
-rw-r--r--src/input/backend/updateaxisactionjob.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/input/backend/updateaxisactionjob.cpp b/src/input/backend/updateaxisactionjob.cpp
index 63e7ff658..f811c9ac0 100644
--- a/src/input/backend/updateaxisactionjob.cpp
+++ b/src/input/backend/updateaxisactionjob.cpp
@@ -188,7 +188,11 @@ void UpdateAxisActionJob::updateAxis(LogicalDevice *device)
if (!buttons.isEmpty()) {
// TO DO: Linear Curver for the progression of the scale value
if (anyOfRequiredButtonsPressed(buttons, physicalDeviceBackend))
- axisValue += buttonInput->scale();
+ buttonInput->updateSpeedRatio(m_currentTime, ButtonAxisInput::Accelerate);
+ else if (buttonInput->speedRatio() != 0.0f)
+ buttonInput->updateSpeedRatio(m_currentTime, ButtonAxisInput::Decelerate);
+
+ axisValue += buttonInput->speedRatio() * buttonInput->scale();
}
}