summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qnsview_tablet.mm
Commit message (Collapse)AuthorAgeFilesLines
* Cocoa: deal with unexpected tablet events without proximityShawn Rutledge2022-07-011-6/+10
| | | | | | | | | | | | | | If the user has a Wacom stylus in proximity of the tablet already (perhaps left it lying on the tablet) and starts a Qt application, we don't get to see a proximity enter event, so a lot of device information is missing; nevertheless, creating a stop-gap device (with ID 0, type Unknown) makes it possible to get basic QTabletEvents with pressure, until the next time the stylus leaves and comes back into proximity. Pick-to: 6.4 Fixes: QTBUG-65559 Change-Id: Ibacbdb78461c0b62d4040c80d210a1b06074e952 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-38/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* QFlatMap: add insert_or_assignMarc Mutz2022-01-121-1/+1
| | | | | | | | | | | | | | | | This does exactly what insert() on Qt associative containers does, but allows to express the intent of using the STL-incompatible Qt insert() semantics, in an STL-compatible way, instead of leaving the reader of the code wondering what semantics are expected. This is part of a very-long-term goal of fixing Qt associative container's insert() behavior, in which QFlatMap, being an affected, but private-API type, is used for proof-of-concept purposes. Task-number: QTBUG-99651 Pick-to: 6.3 6.2 Change-Id: I69010285438259918aef659d3235180c1b5be696 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Register Wacom tablet devices on cocoaShawn Rutledge2021-09-231-90/+98
| | | | | | | | | | | After 6589f2ed0cf78c9b8a5bdffcdc458dc40a974c60 it's possible and expected that each platform plugin will register the input devices it discovers. Task-number: QTBUG-46412 Pick-to: 6.2 Change-Id: I76c9252bc14c5c8e6af3ecc9b26211f6f301103d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* iOS: Handle keyboard events when using an external keyboardAndy Shaw2021-01-201-1/+1
| | | | | | | | | | | | | | | | | | This enables the two possible approaches for handling external keyboard events. While support still exists for before 13.4 then both approaches are needed. This ensures that all external keyboard events are handled as key events and passed on accordingly. Additionally, this accounts for possible shortcuts too, therefore a new function is added to QShortcutMap to aid that. As a result, code has now moved from QCocoaKeyMapper to be part of the gui/platforms/darwin part to make it easier to reuse this code elsewhere. Fixes: QTBUG-85727 Change-Id: I349af43468b03fd8dcb16adba02669974affe154 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix compile warningVolker Hilsheimer2020-11-061-2/+2
| | | | | | | | QInputDevice data types changed from 16 bit to int in 742de50c5ec01f93cf0e193a8a131cbd913cb787 Change-Id: Id2760b5b685e5efc14ee6f9e36e2b30a5b188cdd Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: Move Cocoa modifier mapping logic to QCocoaKeyMapperTor Arne Vestbø2020-07-021-1/+1
| | | | | | | Along with similar logic for Carbon. Change-Id: Ie32f8ffa336006387d50d3b9e8491816aba4ea04 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Fix compile warnings when passing short ints into printf formattingVolker Hilsheimer2020-06-251-2/+2
| | | | | | | Use %hd instead of %d. Change-Id: I0062a507140d70263770cd7fe923efe94822d00e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Introduce QInputDevice hierarchy; replace QTouchDeviceShawn Rutledge2020-06-161-19/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have seen during the Qt 5 series that QMouseEvent::source() does not provide enough information: if it is synthesized, it could have come from any device for which mouse events are synthesized, not only from a touchscreen. By providing in every QInputEvent as complete information about the actual source device as possible, we will enable very fine-tuned behavior in the object that handles each event. Further, we would like to support multiple keyboards, pointing devices, and named groups of devices that are known as "seats" in Wayland. In Qt 5, QPA plugins registered each touchscreen as it was discovered. Now we extend this pattern to all input devices. This new requirement can be implemented gradually; for now, if a QTWSI input event is received wtihout a device pointer, a default "core" device will be created on-the-fly, and a warning emitted. In Qt 5, QTouchEvent::TouchPoint::id() was forced to be unique even when multiple devices were in use simultaneously. Now that each event identifies the device it came from, this hack is no longer needed. A stub of the new QPointerEvent is added; it will be developed further in subsequent patches. [ChangeLog][QtGui][QInputEvent] Every QInputEvent now carries a pointer to an instance of QInputDevice, or the subclass QPointingDevice in case of mouse, touch and tablet events. Each platform plugin is expected to create the device instances, register them, and provide valid pointers with all input events. If this is not done, warnings are emitted and default devices are created as necessary. When the device has accurate information, it provides the opportunity to fine-tune behavior depending on device type and capabilities: for example if a QMouseEvent is synthesized from a touchscreen, the recipient can see which touchscreen it came from. Each device also has a seatName to distinguish users on multi-user windowing systems. Touchpoint IDs are no longer unique on their own, but the combination of ID and device is. Fixes: QTBUG-46412 Fixes: QTBUG-72167 Task-number: QTBUG-69433 Task-number: QTBUG-52430 Change-Id: I933fb2b86182efa722037b7a33e404c5daf5292a Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* macOS: Simplify Objective-C namespacingTor Arne Vestbø2019-10-151-1/+1
| | | | | | | | | | | | | | | | We only need to use the QT_MANGLE_NAMESPACE macro when declaring the interface of the class. As long as we couple that with an alias declaration using QT_NAMESPACE_ALIAS_OBJC_CLASS, any further uses of the class name can be un-namespaced, including declaring categories on the class. The only snag with QT_NAMESPACE_ALIAS_OBJC_CLASS is that it can only be used once per class and translation unit, so forward declarations get hairy, but we can avoid that by just including the headers instead. Change-Id: I333bcd18fe1e18d81fbd560b0941c98b1c32460e Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* macOS: Update all deprecated enums to their 10.12+ equivalentsTor Arne Vestbø2018-08-311-6/+6
| | | | | Change-Id: I3034258da95c9c70eb6758db92967f438617f6e9 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* macOS: Split up qnsview.mm into separate category-files for major areasTor Arne Vestbø2018-03-171-0/+223
Makes it easier to get an overview of the code, work on separate sections/areas in isolation, and highlights which part of the APIs we are using from outside of QNSView, and internally between the different parts of QNSView. Change-Id: Ia2c5ab9a68bf75feddba853ac20d3bb397f7564b Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>