summaryrefslogtreecommitdiffstats
path: root/src/core/web_event_factory.cpp
Commit message (Collapse)AuthorAgeFilesLines
* WebEventFactory: Use QKeyEvent::key() if QKeyEvent::text() is emptyJüri Valdmann2018-08-271-13/+52
| | | | | | | | Fixes missing dom_key issue when ControlModifier is used on Linux and macOS. Task-number: QTBUG-69442 Change-Id: Icd644d019494fd3c95269b42c71efd747507a3ea Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* WebEventFactory: Fallback for WebKeyboardEvent::dom_codeJüri Valdmann2018-08-271-1/+7
| | | | | | | | | | Usually this field should be computed from the native scan code, but sometimes we do not have a native scan code (in tests, for example). Add a fallback case to compute this field from windows_key_code, with test. Task-number: QTBUG-69442 Change-Id: I046094032576f4215cc8b3a6ced699a86ea148a9 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* WebEventFactory: Fix WebKeyboardEvent::dom_code on macOSJüri Valdmann2018-08-271-5/+8
| | | | | | | | | | | Currently this field is always computed from QKeyEvent::nativeScanCode, but this is not correct on macOS where nativeVirtualKey should be used instead (there is no nativeScanCode on macOS). Fix by using native_key_code which already takes this into account. Task-number: QTBUG-69442 Change-Id: I7c99d7d147ab68bac7ab91101de173eb04fa5c03 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* WebEventFactory: Fix WebKeyboardEvent::native_key_code on Windows and LinuxJüri Valdmann2018-08-271-1/+25
| | | | | | | | | Currently this field is filled from QKeyEvent::nativeVirtualKey, but this is correct only on macOS (cocoa). Other platforms should use nativeScanCode. Task-number: QTBUG-69442 Change-Id: I097ec4c726a9d249c0adfbc620d2585983f6246c Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* WebEventFactory: Use runtime platform detectionJüri Valdmann2018-08-271-6/+40
| | | | | | | | | Make sure that the platform specific code paths are only taken when the relevant QPA plugin is actually used. Also detect if eglfs plugin is using Xkb key codes. Task-number: QTBUG-69442 Change-Id: I9546b61ad8d9f15020a96f8c0006d056aa157fcc Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* WebEventFactory: Consistently unswap Control and Meta on macOSJüri Valdmann2018-08-271-30/+44
| | | | | | | | | Move swapping logic to separate helper functions and use them also for filling out windows_key_code and dom_key. Task-number: QTBUG-69442 Change-Id: Id3b883b28b877d54315c5e2fb0d77bad250f2462 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Merge remote-tracking branch 'origin/5.11' into 5.12Michael Brüning2018-08-211-0/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf configure.json examples/webenginewidgets/markdowneditor/resources/3rdparty/marked.js examples/webenginewidgets/markdowneditor/resources/3rdparty/qt_attribution.json examples/webenginewidgets/markdowneditor/resources/markdowneditor.qrc mkspecs/features/platform.prf src/3rdparty src/core/media_capture_devices_dispatcher.cpp src/core/net/url_request_context_getter_qt.cpp src/core/net/url_request_context_getter_qt.h src/core/web_contents_adapter.cpp Change-Id: I467133ba455b1f85f6bb61793794c31cb1094541
| * Compile with -no-feature-tableteventAndy Shaw2018-06-291-0/+6
| | | | | | | | | | Change-Id: I7e03d6e3347ee9b81a7414574098827b5773b7b4 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Adaptations for Chromium 67Allan Sandfeld Jensen2018-06-261-6/+6
|/ | | | | Change-Id: I13cedba56012f74651a044d6fa8f0957487bf3eb Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Basic adaptations for 65-basedAllan Sandfeld Jensen2018-03-151-0/+19
| | | | | Change-Id: I121b14d6a44e80f5eea4b159c58f7010d472926e Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Basic adaptations for 64-basedAllan Sandfeld Jensen2018-03-151-13/+8
| | | | | Change-Id: I11e2da206e4e59872a38c178f57a5879c1bbf229 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Merge remote-tracking branch 'origin/5.10' into devAllan Sandfeld Jensen2018-01-171-1/+2
|\ | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/webengine/api/qquickwebengineview_p_p.h src/webenginewidgets/api/qwebenginepage_p.h tests/auto/quick/qmltests/data/TestWebEngineView.qml Change-Id: Id2acc92e8d0364bdaaf5a63ea2d2cb9cd533ade3
| * Merge remote-tracking branch 'origin/5.9' into 5.10Allan Sandfeld Jensen2018-01-081-1/+2
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/core/api/qwebengineurlrequestjob.cpp src/core/browser_context_adapter.cpp src/core/renderer/user_resource_controller.cpp src/core/web_engine_context.cpp src/webenginewidgets/api/qwebenginepage.cpp Change-Id: I5278e5e22e1776d42975fc94d70ff8ca4f81fb9a
| | * Fix invalid access in currentTimeForEventAlexandru Croitor2017-12-141-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | The method currentTimeForEvent() tried to access the timestamp() method for a QEvent::Leave event. Leave events are regular QEvents and not QInputEvents, and thus have no such method. Change-Id: Iecc20d239b0e2a5b39b995dabdd7ca8fb44491aa Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| | * Fill pointerType member of pointer eventsSzabolcs David2017-11-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix pointerType of the currently supported (mouse and touch) events. Support of pen and eraser types is coming with QTBUG-62975. Backport of 5.10 fix: 64ad0e8b335509970062ba550a06018426b7c285 Task-number: QTBUG-63266 Task-number: QTBUG-64436 Change-Id: Ief32b9680ab5acfb15537aba74c2bcdd6f51c978 Reviewed-by: Viktor Engelmann <viktor.engelmann@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | | Merge remote-tracking branch 'origin/5.10' into devAllan Sandfeld Jensen2017-11-291-3/+96
|\| | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/core/web_event_factory.cpp src/core/web_event_factory.h src/webengine/render_widget_host_view_qt_delegate_quick.h Change-Id: Ic43787e2689c81b501ed395a990190eb67d83a2b
| * | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-11-151-3/+15
| |\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/3rdparty tests/auto/quick/qmltests/qmltests.pro tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp Change-Id: I2a1e3a83e29a1d6709f3e98fda3f7b4ab7ab297e
| | * Notify Chromium about leaving viewPeter Varga2017-11-091-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | Forward QEvent::Leave for Widget and QEvent::HoverLeave for Quick. Task-number: QTBUG-64265 Change-Id: Ide32768902956476d24b1d4115e305392b62feb3 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| * | Fill pointerType member of pointer eventsSzabolcs David2017-11-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fix pointerType of the currently supported (mouse and touch) events. Support of pen and eraser types is coming with QTBUG-62975. Task-number: QTBUG-63266 Change-Id: Ief32b9680ab5acfb15537aba74c2bcdd6f51c978 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
| * | Pass editor shortcuts to Chromium by ForwardKeyboardEventWithCommandsPeter Varga2017-11-031-0/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Moreover, extend the list of supported editor shortcuts and stabilize the corresponding auto test. Task-number: QTBUG-54692 Task-number: QTBUG-54812 Task-number: QTBUG-54221 Task-number: QTBUG-59053 Change-Id: I4dd8230519639ea6e3340992dbb54a609ecfcd91 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | | Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-11-031-15/+33
|\| | | | | | | | | | | | | | | | | | | | Conflicts: src/3rdparty Change-Id: Ie6b1922db2269e0e0561022162228a7c8609c9ba
| * | Coalesce wheel events when possibleAllan Sandfeld Jensen2017-10-271-15/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Combine wheel events if we are getting more than Chromium can handle. This improves latency and perceived performance when scrolling with touchpads or fine-grained mouse, on a slow machine or with a debug build. Change-Id: Id847c8e7782e155c28067b6051ce92896b68ca7a Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* | | Support tablet devicesSzabolcs David2017-11-031-3/+45
|/ / | | | | | | | | | | | | | | | | Process QTabletEvents and forward them to Chromium in order to support pressure, tilting, rotation, eraser and similar features of tablet devices. Change-Id: I763d9e6e7036c29715a0b5531d3c6363eb4fcd8c Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into 5.10Allan Sandfeld Jensen2017-09-141-3/+2
|\| | | | | | | Change-Id: I0860a46b981c1f711bec45d7a495bcec2a80ee1f
| * Fix translation of Qt::Key_MenuJoerg Bornemann2017-09-081-3/+2
| | | | | | | | | | | | | | | | | | | | | | VK_MENU is the virtual key code for the Alt key, but Qt::Key_Menu is the context menu key which maps to VK_APPS. Now the menu key can be used to invoke the context menu on web pages. Task-number: QTBUG-58306 Change-Id: I8674ab84848b5c8732e4d0cf189909191b85d562 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Adaptations for Chromium 59Allan Sandfeld Jensen2017-09-111-93/+88
| | | | | | | | | | Change-Id: I472053e316bfa782d0a6fb8903f4901be12247ae Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Merge branch '5.9' into 5.10Allan Sandfeld Jensen2017-09-061-0/+2
|\| | | | | | | Change-Id: I9fe9946ba47f9ef509a861963c83e275a25fffd0
| * Compile with Gestures disabledAlan Alpert2017-09-051-0/+2
| | | | | | | | | | | | Change-Id: Ibad2b8ebb90e79ff8337d994b2234eed5e230daa Reviewed-by: Romain Pokrzywka <romain.pokrzywka@gmail.com> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Use QStyleHints::wheelScrollLines when create WebMouseWheelEventPeter Varga2017-07-031-2/+7
| | | | | | | | | | Change-Id: I01fb4f9ff943df935887b40cb75d7656d2b6ac20 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Simple adaptations for Chromium 58Allan Sandfeld Jensen2017-06-141-2/+2
| | | | | | | | | | Change-Id: I7c2c85973b03fdbd2eafb5339f33a3758d53e924 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* | Adaptations for Chromium 57Allan Sandfeld Jensen2017-06-141-17/+18
|/ | | | | Change-Id: Ia2756c1e9b13839c2330bd98cf953d47cbdac0dd Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* Implement proper touch handling on macOSAlexandru Croitor2017-04-211-0/+37
| | | | | | | | | | | | | | | Use the OS provided QNativeGestureEvents for pinching and smart zooming. This replaces the usage of the Android based gesture recognizer on macOS. This also implements multitouch gestures to work with the Qt Quick implementation of QtWebEngine for macOS, because touch events are ignored by default on macOS in QQuickItem. Task-number: QTBUG-58779 Change-Id: I17399e4e89a57557540b2fd0940a445326b682f3 Reviewed-by: Florian Bruhin <qt-project.org@the-compiler.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix movementX and movementY properties of mouse eventsSzabolcs David2017-03-241-0/+2
| | | | | | | | | | Calculate movementX/movementY at every turn, not only when the mouse is in locked state. Task-number: QTBUG-59127 Change-Id: I362e055e6b5d6f831671604a093434373cedf19a Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Simple adaptations to Chromium 55Allan Sandfeld Jensen2017-03-011-9/+8
| | | | | | | The simplest adaptations to API and build changes in Chromium 55 Change-Id: I923fa188690a04902492317807f72f006bcab9c6 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Fix confirming IME composition and newline insertionPeter Varga2017-01-251-0/+9
| | | | | | Task-number: QTBUG-55766 Change-Id: I3be3b224dfef9ecc1ce39f4f20ec5c1d13c0fa69 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Generate domKey for printable charactersPeter Varga2016-10-051-0/+3
| | | | | | | | | This fixes the key event when spacebar is pressed (for example above a checkbox). Task-number: QTBUG-56283 Change-Id: I76bcc9a66abcef3a9e5ac10cfa53d60fce4c9179 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Fix keyboard event handlingPeter Varga2016-10-041-0/+553
| | | | | | | | | | Set domKey and domCode property of NativeWebKeyboardEvent. Blink uses this new interface for keyboard event handling: https://codereview.chromium.org/2045603002 Task-number: QTBUG-56242 Change-Id: I33f6f17087629f5021874cacd3e75295bbd97870 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Merge remote-tracking branch 'origin/5.6' into 5.7Allan Sandfeld Jensen2016-08-021-2/+15
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/3rdparty src/core/resources/resources.gyp src/webengine/doc/src/qtwebengine-overview.qdoc src/webenginewidgets/api/qwebenginepage.cpp src/webenginewidgets/api/qwebenginescriptcollection.cpp src/webenginewidgets/api/qwebenginescriptcollection_p.h tests/auto/widgets/qwebenginepage/BLACKLIST And readded newly in 5.6 enabled tests to the BLACKLIST. Change-Id: I4ab1fc54ebfaaf940df81b0d8d6bdd15cae8b7c4
| * Fix regression in text selectionAllan Sandfeld Jensen2016-07-041-0/+13
| | | | | | | | | | | | | | | | | | While 'button' should officially be none on mouse move events, the aura and windows events set 'button' on mouse move, and selection code appears to depend on it. Change-Id: I49f84e6f9178c3b2cb0f2c2c8a7b1d30141d0b4e Reviewed-by: Michael Brüning <michael.bruning@qt.io>
| * Fix regression with fine-grained wheel eventsAllan Sandfeld Jensen2016-07-041-2/+2
| | | | | | | | | | | | | | | | The division needs to be done in float, otherwise steps smaller than one standard tick will be rounded to zero. Change-Id: Id939be062f1575104ca6cd66f05892841ec27569 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Allan Sandfeld Jensen2016-06-271-7/+4
|\| | | | | | | Change-Id: Ic6686df8f82f710a3441501b7eeaffe69fbcbdf7
| * Use angleDelta instead of deprecated Qt4 deltaAllan Sandfeld Jensen2016-06-231-7/+4
| | | | | | | | | | | | | | | | Switch to using the Qt5 angleDelta instead of the Qt4 style delta that can only handle single orientation wheel events. Change-Id: I181dda03c7fc9c676100cb31ab7717f9641b625e Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Allan Sandfeld Jensen2016-06-171-3/+3
|\| | | | | | | Change-Id: If4d8a25f5a2192a658d031252435935cbc675725
| * Fix translation of multiple pressed mouse buttonsAllan Sandfeld Jensen2016-06-141-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | We were reporting any mouse button event where the left mouse button was held as a left mouse button event. We should instead separate the button changed and the ones held. Also adds test of the translation. Change-Id: I1139d6615d54a036dfe843fdb1d1c90b23b467b5 Reviewed-by: Alexandru Croitor <alexandru.croitor@theqtcompany.com> Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* | Unify license header usage.Jani Heikkinen2016-02-011-11/+14
|/ | | | | | | | | Update files using old header.LGPL3 to use header.LGPL Update files using old header.FLD to use new header.FDL Update files using old header.BSD to use new header.BSD Change-Id: I36a67aaa8c3ca6c7946308defc9c03c3571a7d23 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Update key code mappings using QtWebkit mappings as reference.Alexandru Croitor2016-01-121-7/+24
| | | | | | | | | Copy additional key code mappings from PlatformKeyboardEventQt.cpp. Also add a mapping for missing numeric keypad equals key. Change-Id: Ia6c4413795293be84bcd8ea9d981d8cdfb94509b Task-number: QTBUG-50401 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Send proper key codes for KeyEvents to WebKit.Alexandru Croitor2016-01-111-2/+4
| | | | | | | | | A few KeyEvents to key code mappings were incorrect or missing. Fix them. Change-Id: I74087768fddd467993f04ed8b4c2dc6345d20e8a Task-number: QTBUG-50354 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* Do not set meta modifier twiceAllan Sandfeld Jensen2015-06-291-2/+0
| | | | | | | | We were setting the meta modifier twice. This breaks CTRL short-cuts on OS X since it may cause both CTRL and Meta to set. Change-Id: Ia4fa229b5b466235207afbe4a27a8078b3b2c876 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-161-7/+7
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: Ieb6bac7a1be5c25eb7cb917495b58b6a870ca6d4 Reviewed-by: Pierre Rossi <pierre.rossi@theqtcompany.com>
* Propagate unhandled key events to the QtWebEngine view's parentJocelyn Turcotte2015-02-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | This allows applications to receive unhandled key events from the page by setting an event handler on the view's parent widget/item, like it was possible with QtWebKit. This is different in that events first have to asynchronously go through the QtWebEngineProcess. If the WebEngine view has the keyboard focus, the events will be consumed inconditionally by the RenderWidgetHostViewQtDelegates, and a copy will be resent to the view's parent if it wasn't consumed. This sends it to the parent instead of the QWebEngineView directly since those are only unhandled events, unlike with other widgets where you can first intercept events. It is done that way also in cases where the QWebEngineView would be be the focus widget directly in the future, instead of the RWHV. If applications want to intercept key events before they reach the page, they need to use an event filter on the QWebEngineView's children or globally on the application. Change-Id: I3b48f5212d3f238a1c0497cec1db6ae3badbad26 Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>