summaryrefslogtreecommitdiffstats
path: root/src/input
Commit message (Collapse)AuthorAgeFilesLines
* QInputAspect: slightly simplify createPhysicalDevicePaul Lemire2016-08-271-3/+4
| | | | | Change-Id: Ibb21c59904bd7077e0e254fce5822241b2b9ee82 Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
* UpdateAxisActionJob: only perform job if device enabledPaul Lemire2016-08-271-0/+4
| | | | | | Change-Id: Ie5b29563f5e88df6cce14655a0e3fb35fc8de1fa Task-number: QTBUG-55469 Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
* LogicalDevice: make testablePaul Lemire2016-08-261-2/+1
| | | | | | | | By exporting it and making sceneChangeEvent public like in most other backend classes. Change-Id: I8d8a8c16c0ffebd79758f1021fb5ed5fe92e2571 Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
* Merge branch '5.7' into 5.8Sean Harmer2016-08-2513-87/+274
|\ | | | | | | | | | | | | Conflicts: tests/auto/input/input.pro Change-Id: Ic89c7d9093c95bc1c5ca50f04ed34c00b5f261f4
| * Frontend is in ms but backend in nsKevin Ottens2016-08-255-12/+14
| | | | | | | | | | Change-Id: Id57a69a80f9eddb28fd2e75ea55baf98dcac452c Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Fix order handling in input sequencesKevin Ottens2016-08-241-0/+3
| | | | | | | | | | | | Change-Id: I79c159c70ed81345b58c6dabfd60437e20554e94 Task-Id: QTBUG-54585 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Fix spurious sequence trigger on first key pressKevin Ottens2016-08-241-0/+1
| | | | | | | | | | | | Change-Id: I2c8a34009d3bac400f5e156fe6321af744960de5 Task-Id: QTBUG-54585 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Fix timeout handling in input chordsKevin Ottens2016-08-241-9/+15
| | | | | | | | | | Change-Id: Ic4ab2d781403ada1206e7429ad1cd16ea2330aed Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Fix spurious chord trigger on first key pressKevin Ottens2016-08-241-0/+1
| | | | | | | | | | Change-Id: If5a28e670e8eef0a9b5a75dc3451ee584f22e72c Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Move input, chord and sequence logic out of jobKevin Ottens2016-08-244-61/+62
| | | | | | | | | | | | | | | | | | | | The bookkeeping and activation logic of ActionInput, InputChord and InputSequence now move outside of the job, which make them testable properly. The tests already show bugs which will be fixed in following commits. Change-Id: I4e434118a6ba285d08632c43d487b17ee5b4cb66 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Add convenience to look for action inputs by idKevin Ottens2016-08-242-0/+14
| | | | | | | | | | | | | | | | It will look in all the possible resource managers for the corresponding id. Change-Id: I335099cd4d718cdebb9b9b3381f751f3001bfb1e Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Action input nodes inherit from the abstract classKevin Ottens2016-08-246-15/+36
| | | | | | | | | | | | | | | | ActionInput, InputChord and InputSequence all inherit from AbstractActionInput now. Their process method does nothing yet though. Change-Id: I0e3aee41b2c41aa4ee16144fa1e67de95466ea63 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Add an AbstractActionInput base classKevin Ottens2016-08-243-0/+139
| | | | | | | | | | | | | | | | | | | | | | This is needed for the coming refactoring improving testability in the input aspect. Right now we got some of the action input logic done inside the job and some inside the class. This is in part due to the lack of common interface between the different action input backend node. This is a first step toward solving that. Change-Id: I803ecd1f114f635d2b275d5dadc493733fc580e8 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * QInputAspect::jobToExcute: time is in fact usedKevin Ottens2016-08-241-1/+0
| | | | | | | | | | Change-Id: I63f19713c3c7b248b9e278f54201d6da2aba9d55 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-08-231-0/+1
|\| | | | | | | Change-Id: I2ba85f57eb5801d720b5a8f2e8477e8ca9abefec
| * MouseDevice: initialize m_inputHandlerEdward Welbourne2016-08-161-0/+1
| | | | | | | | | | | | | | Coverity (CID 161407) grumbles justly. Change-Id: Iec204dfc305c70d54d292893d26a8191038449d1 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Long live QAxisAccumulator!Sean Harmer2016-08-114-2/+465
|/ | | | | | | | | | Allows to treat axis values as acceleration or velocity and accumulates (integrates) a quantity from an axis input. Allows to avoid using FrameAction in several cases and a more declarative way of expressing such relationships. Change-Id: I853d7467265c39043a4dbb685a9076dd11ff2e90 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* MouseDevice: do not reset the MouseState if we have not received eventsPaul Lemire2016-07-191-6/+4
| | | | | | | | | Only reset the axes but keep the old button state for the buttons as having no new events means the state hasn't changed since the last frame. Change-Id: I8de6e1cd0a42ac3d70228876032ed9fb98e2e979 Task-number: QTBUG-54706 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* KeyboardDevice: do not store handles/ids of input devicesPaul Lemire2016-06-304-32/+3
| | | | | | | | To avoid having cases where the id is valid but the node is not yet created returning an invalid handle and breaking behavior. Change-Id: I0f24eac89a62a9febe7dcac814cb91332ad0905b Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix MouseHandler/SourceDevice mouse event dispatchingPaul Lemire2016-06-304-39/+14
| | | | | | | | | | | | | | | | The MouseHandler was retrieving a MouseDevice pointer and registering itself against the MouseDevice from a MouseDevice Id. But this goes against the nature of Qt3D where you have no garantee about the creation order. So even though the MouseDevice Id was correct the MouseDevice retrieved was null at that point. This in turn meant that the MouseHandler wasn't registered and that not even would be transmitted. This is now fixed by only storing the id and performing the lookup only when we are sure everything as been created. Change-Id: I947e95648b1f9f9239527db588fa99b3f12f48dd Task-number: QTBUG-54067 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* QMouseHandler: proper bookkeeping of QMouseDevicePaul Lemire2016-06-301-0/+15
| | | | | Change-Id: Ib9fc09c038fed225efdd44e6c6286351f4c74ce2 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* QMouseHandler: fix onPressed/onPressAndHoldPaul Lemire2016-06-292-12/+25
| | | | | | | | wasHeld always returned through on touchpads which resulted in all press event being emitted as pressAndHold events. Change-Id: I0eca2cd123d672f788bea3c7ec52afe44a0383c6 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Input: set profiling type on the jobsPaul Lemire2016-06-284-0/+8
| | | | | Change-Id: I42df9d597fa4d5cd5b4b3d8618fc8195ffbe3e1c Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Input: add job types to ease profilingPaul Lemire2016-06-282-1/+81
| | | | | Change-Id: I7a310894d159c481d36f99d08fd5b52e63e0315e Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix -Wreorder warning in MouseDeviceSean Harmer2016-06-211-1/+1
| | | | | Change-Id: I0a2e4414419a1183bb9338fc419dc03e028cf5a4 Reviewed-by: Volker Krause <volker.krause@kdab.com>
* Merge branch '5.7.0' into 5.7Sean Harmer2016-06-1418-89/+799
|\ | | | | | | Change-Id: I6e7f3fded06f8295f33998196e826ac6d4b1513e
| * More doc for input ModuleColin Ogilvie2016-06-0317-77/+573
| | | | | | | | | | | | Task-number: QTBUG-46037 Change-Id: Ifc90bdc84bfd44e29e9287c1e7d24108b36e900d Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Transfer previously written doc for input moduleColin Ogilvie2016-06-038-48/+262
| | | | | | | | | | | | Task-number: QTBUG-46037 Change-Id: I43a3b84cb55e67b30b1b145aabbffa23f9cf9017 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Avoiding badly quantized axis input valuesSean Harmer2016-06-111-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | When moving rapidly Qt may generate multiple mouse events per frame. The old logic was to overwrite the axis values calculated from each mouse event. It is more correct to accumulate the axis values from all events in a frame, which is exactly what this patch does. With this commit, the camera controllers are now much more smooth and feel more natural to control. Change-Id: I50c25609702e5f16e303abf8fb9e7697838f7e2e Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Don't jump input when releasing and pressing mouse button elsewhereSean Harmer2016-06-112-2/+8
| | | | | | | | | | | | | | | | | | | | Track when the button is actually held and only update axis values in this case. This prevents the camera controller from being "jumpy" if you release the mouse, move cursor elsewhere, then press the button again. Change-Id: Icf12366aa84865d276e2627e4959c0106b33f57d Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Fix reset in input event filters in shutdownMäättä Antti2016-06-086-0/+34
|/ | | | | | | | | | | | | | | | The event filters can cause reset if they remain registered while the scene is being shutdown. If the filters are not unregisteded, they will continue receiving events when the shutdown deallocates them. Unregister filters when the scene is being shutdown, except the eventSource filters, since the eventSource might be already deallocated by that point. Add connection to eventSource destroyed signal to prevent this. Task-number: QTBUG-53834 Change-Id: I1dd1875b98021592580dd59a178ad18308c7d67c Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix warning about unregistered metatype for QAbstractPhysicalDevicePaul Lemire2016-05-272-1/+1
| | | | | Change-Id: I20b430cf2a9b27b0c13b42d0e6a2667e50cfe4a8 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Add doc skeleton for Qt3DInputTomi Korpipää2016-05-2520-133/+509
| | | | | | | | | | | | | Conflicts: src/input/frontend/qanalogaxisinput.cpp src/input/frontend/qaxis.cpp src/input/frontend/qaxissetting.cpp src/input/frontend/qbuttonaxisinput.cpp src/input/frontend/qinputsettings.cpp src/input/frontend/qmousedevice.cpp Change-Id: Ic3e06179f745520d9c49af8d8242af360cbd20d8 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Unit tests for QKeyboardHandlerKevin Ottens2016-05-234-5/+8
| | | | | | | | | Also repairs the sourceDevice notification change since the tests showed up it was broken. Change-Id: I20b81806452e54f89353f35464b5241de6e18a99 Task-number: QTBUG-53358 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Shared node bookkeepingPaul Lemire2016-05-238-0/+63
| | | | | | | | | | | | Any time a property references a QNode there is a risk that the node gets destroyed and then the property is left pointing to a dangling pointer. To handle such cases, setters of such properties are able to use a helper that internally connect QObject::destroyed signal to a setter removal method. Change-Id: I42428c851d0e3d2d88ab0cf6a5b75605334ec648 Task-number: QTBUG-53456 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Repair AxisSetting handling in physical devicesKevin Ottens2016-05-232-19/+36
| | | | | | Change-Id: I9989f5ccf7871eb60083c4fcb40d4eb9158b1b19 Task-number: QTBUG-53358 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Use QVector instead of QVariantList propertiesKevin Ottens2016-05-234-24/+10
| | | | | Change-Id: I183bac3fb423d068df4f65ae96a7706f83cfa20f Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* De-inline some more dtors of non-leaf Private classesMarc Mutz2016-05-196-3/+21
| | | | | Change-Id: I2d80f964c4de6ef6cef144ca50fa12ffb3eb540c Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Introduce QAbstractActionInputPrivateMarc Mutz2016-05-1910-23/+101
| | | | | | | | | | | We need to have an unbroken chain of Private classes for BC reasons. Adding one in the middle after a BC release is going to be much harder, since, in this case, we already have an exported function that names QNodePrivate instead of QAbstractActionInputPrivate. Change-Id: Iaf3730f7a30a13b388d632c068d7c80319672057 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* De-inline dtors of public polymorphic classesMarc Mutz2016-05-1935-0/+106
| | | | | | | | | | | | | | By making the destructor (usually the first non-inline, non-pure, virtual function, and therefore the trigger for most compilers to emit the vtable and type_info structures for the class in that TU) out-of-line, vtables and, more importantly, type_info structures for the class are pinned to a single TU. This prevents false negative dynamic_cast and catch evaluation. It also allows to add code to them later, if necessary. Change-Id: I0da301cd788162abba6cdbbb21910090a22adb9a Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Remove #if defined(Q_COMPILER_TEMPLATE_ALIAS)Sean Harmer2016-05-181-11/+0
| | | | | | | All supported configurations now handle template aliases properly. Change-Id: I0fbda7a870af3af918c97a58f02155c9663fb50a Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
* Add more explicitMarc Mutz2016-05-141-2/+2
| | | | | | Change-Id: Iaa91d6248cbc3822ed3380e360d2880d4894446d Reviewed-by: Paul Lemire <paul.lemire@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* De-inline dtors of aspect classesMarc Mutz2016-05-142-0/+6
| | | | | | | | | Costs 170B each in Logic, Render, Input, but otherwise we'll not be able to add code to the dtors down the line until Qt 6. Change-Id: Icf71bd959f2efa3c67bccaf166569e06a013fef1 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Use some constructor delegationMarc Mutz2016-05-142-1/+8
| | | | | | | | | | | | | to avoid code duplication (in both: executable and source code senses). Text size savings on optimized GCC 6.0 Linux AMD64 builds: Core: 16 Logic: 192 Input: -304 Render: 408 Change-Id: I23dd01fd4efe226c22942c24b21bbe20027c90b1 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Enable QT_NO_FOREACH for some librariesMarc Mutz2016-05-141-0/+3
| | | | | | | | | The core, extras, input, logic and render libraries contain no Q_FOREACH loops anymore. Enable QT_NO_FOREACH so it stays that way. Change-Id: Ie2fa6b7621cce2c89f76cf37d1511bf8c16c13ee Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Qt3DInput: eradicate remaining Q_FOREACH loopMarc Mutz2016-05-141-10/+10
| | | | | Change-Id: Ib3347e8f6bde8cfae9529c72bf63c93b21be213d Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Qt3D: replace QStringLiteral with QLatin1String when appending or comparingMarc Mutz2016-05-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It makes little sense to use QStringLiteral in the following situations: - for comparison to a QString, because operator== is overloaded for QLatin1String. - when constructing an empty QString, because QLatin1String("") resolves to sharedEmpty() when converted to QString, which is preferable to an independent copy of sharedEmpty(). - for strings which are immediately appended to, or which are appended to other strings. because no dynamic memory allocation is saved by doing so. But if the only advantage of QStringLiteral does not apply, all its disadvantages dominate, to wit: injection of calls to the qstring dtor, non-sharability of data between C strings and QStringLiterals and among QStringLiterals, and doubled storage requirements. Fix by replacing QStringLiteral with QLatin1String or QLatin1Char, as needed. Ported one use of QString::number(i) to QLatin1Char('0' + i) where i is guaranteed to be < 10. Saves 179B and 2150B, resp., in Input and Render text size on optimized Linux AMD64 GCC 6.0 builds. Change-Id: I2e8f43ed085875ce387ffddb18bba37ff21f6cf0 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Remove QBackendNodePropertyChangeSean Harmer2016-05-137-17/+18
| | | | | | | | Not needed as we can just use delivery flags on QPropertyUpdatedChange. Task-number: QTBUG-51494 Change-Id: I53b52ac7a1b226dd30756bcebcdd62bffd3a6fd5 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Linear scaling for key controlled axisColin Ogilvie2016-05-127-1/+102
| | | | | Change-Id: I429fc512a836d569a55f0ac6490d020f1e8c2808 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Rename QNodeRemovedPropertyChange -> QPropertyNodeRemovedChangeSean Harmer2016-05-1012-25/+25
| | | | | | Task-number: QTBUG-51494 Change-Id: I1c7f1c680bc18c6201b790e96dc4023564837122 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>