diff options
author | Robert Brock <robert.brock@kdab.com> | 2016-02-25 13:56:56 +0000 |
---|---|---|
committer | Robert Brock <robert.brock@kdab.com> | 2016-02-29 13:44:47 +0000 |
commit | 491a4d426299e6aa32f05188ce6a1b75203dab02 (patch) | |
tree | 3fc768568e5786c2ec10f1e92408a8138b3fa631 /src/input/backend/updateaxisactionjob.cpp | |
parent | 2a74364d45d711be9ed6194c6877dbd1ad336ba8 (diff) |
QActionInput and QAxisInput keys to buttons
As per API review
renamed keys to buttons as it is more descriptive
Change-Id: If0907b382a863d64bd8d86e2796613767a1fd12b
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/input/backend/updateaxisactionjob.cpp')
-rw-r--r-- | src/input/backend/updateaxisactionjob.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/input/backend/updateaxisactionjob.cpp b/src/input/backend/updateaxisactionjob.cpp index 264d576cb..b3da7535d 100644 --- a/src/input/backend/updateaxisactionjob.cpp +++ b/src/input/backend/updateaxisactionjob.cpp @@ -51,16 +51,16 @@ namespace Input { namespace { -bool anyOfRequiredKeysPressed(const QVector<int> &keys, QAbstractPhysicalDeviceBackendNode *physicalDeviceBackend) +bool anyOfRequiredButtonsPressed(const QVector<int> &buttons, QAbstractPhysicalDeviceBackendNode *physicalDeviceBackend) { - bool validKeyWasPressed = false; - Q_FOREACH (int key, keys) { - if (physicalDeviceBackend->isButtonPressed(key)) { - validKeyWasPressed = true; + bool validButtonWasPressed = false; + Q_FOREACH (int button, buttons) { + if (physicalDeviceBackend->isButtonPressed(button)) { + validButtonWasPressed = true; break; } } - return validKeyWasPressed; + return validButtonWasPressed; } } // anonymous @@ -109,7 +109,7 @@ bool UpdateAxisActionJob::processActionInput(const Qt3DCore::QNodeId actionInput if (physicalDeviceBackend != Q_NULLPTR) { // Update the value - return anyOfRequiredKeysPressed(actionInput->keys(), physicalDeviceBackend); + return anyOfRequiredButtonsPressed(actionInput->buttons(), physicalDeviceBackend); } } else if (m_handler->inputSequenceManager()->lookupResource(actionInputId)) { InputSequence *inputSequence = m_handler->inputSequenceManager()->lookupResource(actionInputId); @@ -172,13 +172,13 @@ void UpdateAxisActionJob::updateAxis(LogicalDevice *device) if (physicalDeviceBackend != Q_NULLPTR) { // Update the value - const QVector<int> keys = axisInput->keys(); + const QVector<int> buttons = axisInput->buttons(); // Axis was specified -> we take this as the base value if (axisInput->axis() != -1) axisValue += physicalDeviceBackend->processedAxisValue(axisInput->axis()); - else if (!keys.isEmpty()) { + else if (!buttons.isEmpty()) { // TO DO: Linear Curver for the progression of the scale value - if (anyOfRequiredKeysPressed(keys, physicalDeviceBackend)) + if (anyOfRequiredButtonsPressed(buttons, physicalDeviceBackend)) axisValue += axisInput->scale(); } } |