summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbkeyboard.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fixed build breaks that result after disabling "contextmenu" featureShrikant Dhumal2015-09-091-0/+2
| | | | | Change-Id: I261f927ee720e0c65abd18417e1ac48dbee820df Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-07-011-4/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.cpp src/corelib/global/qglobal.h src/corelib/global/qsysinfo.h src/corelib/global/qsystemdetection.h src/corelib/kernel/qobjectdefs.h src/plugins/plugins.pro tests/auto/widgets/itemviews/qlistview/qlistview.pro Change-Id: Ib55aa79d707c4c1453fb9d697f6cf92211ed665c
| * Remove useless truncation to the size the string already hasThiago Macieira2015-06-081-4/+2
| | | | | | | | | | | | | | | | | | | | Caused by the refactor in 05351b0cde3e80d2d0ae3a838e802ff6086e4b59. The count was probably wrong in the creation of the QKeyEvent, so this commit keeps it wrong. Change-Id: I049a653beeb5454c9539ffff13e573bba826e927 Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com>
* | Merge remote-tracking branch 'origin/5.5' into devSimon Hausmann2015-06-031-0/+31
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qnamespace.qdoc src/corelib/io/qwindowspipereader.cpp src/corelib/io/qwindowspipereader_p.h src/corelib/statemachine/qstatemachine.cpp src/corelib/statemachine/qstatemachine_p.h src/plugins/platforms/xcb/qxcbconnection.h tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp tests/auto/tools/qmake/tst_qmake.cpp tests/manual/touch/main.cpp Change-Id: I917d694890e79ee3da7d65134b5b085e23e0dd62
| * xcb: Use XIGrabDevice instead of xcb_grab_pointer with XI 2.2Laszlo Agocs2015-06-011-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Switch to using the pointer events from XI2 when touch is available (i.e. version is >= 2.2). This allows us to select and grab the button and motion events together with the touch ones. This prevents the issue of not getting touch events when grabbing via the plain xcb functions. To prevent touch sequences from being replayed after ungrabbing (for example after dismissing a popup that caused a grab), we try to accept touches via XIAllowTouchEvents. Unfortunately this leads to a deadlock and therefore we can only do it when we know we have a new enough libXi. This is a configure time check which is not ideal since the system on which apps run can have a newer libXi than the machine that did the Qt build, but seems like the best we can do. The environment variable QT_XCB_NO_XI2_MOUSE can be set to 1 in order to prevent processing mouse events through XInput. This restores the old behavior with broken grabbing. [ChangeLog][QtGui] Pointer event delivery on X11 is now done via XInput 2.2+ when available. Done-with: Michal Klocek <michal.klocek@theqtcompany.com> Done-with: Alexander Volkov <a.volkov@rusbitech.ru> Task-number: QTBUG-43525 Task-number: QTBUG-45054 Task-number: QTBUG-30417 Change-Id: I7cb2002b31bef4cd527aa427549dcf2d5467968e Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-04-221-0/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/statemachine/qstatemachine.cpp src/corelib/statemachine/qstatemachine_p.h src/gui/painting/qdrawhelper.cpp src/plugins/platforms/xcb/qxcbnativeinterface.cpp src/plugins/platforms/xcb/qxcbwindow.cpp src/plugins/platforms/xcb/qxcbwindow.h src/testlib/qtestblacklist.cpp src/tools/qdoc/node.cpp src/tools/qdoc/node.h tests/auto/gui/painting/qcolor/tst_qcolor.cpp Change-Id: I6c78b7b162001712d5774293f501b06b4ff32684
| * Map X11 AudioPause buttonAllan Sandfeld Jensen2015-04-161-0/+1
| | | | | | | | | | | | | | | | Add a missing mapping for the X11 media key AudioPause. Change-Id: I2888854a021192942c7e8d47d581d834e1f39736 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com>
* | Optimize QXcbKeyboard::lookupString.Milian Wolff2015-04-201-3/+5
| | | | | | | | | | | | | | | | | | | | For the common case of strings smaller than 32 chars this removes a temporary QByteArray allocation and the second call to xkb_state_key_get_utf8. Change-Id: I81cbbf2df683476b38c2ffb96119293cd5b09a90 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Ensure the UTF-8 string for a xcb_keycode_t has the correct length.Milian Wolff2015-04-171-2/+2
|/ | | | | | | | | | | | | | | | | | | On my platform (Archlinux, libxcb 1.11-1) and a recent build of Qt dev I noticed that writing anything to a QLineEdit was broken, as not only the character for the pressed key was inserted, but also what looks like whitespace. A simple debug program showed that a "\u0000" is appended to every character in the QString text associated with a QKeyEvent, which brought me to QXcbKeyboard::lookupString. The QByteArray to QString conversion using QString::fromUtf8 includes the \x00 byte at the end of the buffer. By leveraging the size returned by the xcb API and passing that to QString::fromUtf8 we can prevent this problem from arising. Change-Id: Ic1d4390e4154e9ed729cd23286811d6eecdf54f6 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Pass params of shareable type by const-ref rather than by valueKonstantin Ritt2015-02-131-2/+2
| | | | | | | | ...where passing them by value was not intentional. Change-Id: Ifd5036d57b41fddeeacfbd3f5890881605b80647 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update copyright headersJani Heikkinen2015-02-111-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. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Fix Meta+... shortcuts on XCBKåre Särs2015-02-061-1/+5
| | | | | | | | | | | | | If the window contains a widget that accepts text input, a Meta+... shortcut will be interpreted as if no modifier was pressed. This fix enables the usage of Meta+... shortcuts for the XCB platform plugin. Change-Id: I80034b7e6bbbf18471c86fc77320d5038f5740be Task-number: QTBUG-43572 Reviewed-by: Aleix Pol Gonzalez <aleixpol@kde.org> Reviewed-by: Milian Wolff <milian.wolff@kdab.com> Reviewed-by: David Edmundson <davidedmundson@kde.org> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* xcb: Don't return 0 from QXcbKeyboard::possibleKeysAlexander Volkov2014-12-181-1/+2
| | | | | | | | | | It's possible to get 0 for baseQtKey in case Caps Lock is used as a layout switcher. So don't include this value in the result. Similar fix was in commit d904533acba1267431ca2c5f0d3e85cc59a20a26. Task-number: QTCREATORBUG-9589 Change-Id: I46fc91f9faf6fd0699f062a72fd2ca3187232f5a Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* Fix shortcut handling with non-latin layoutsGatis Paeglis2014-10-271-48/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Shortcut handling with non-latin keyboard layouts were broken for checks like: QKeyEvent key = ...; key == QKeySequence::SelectAll In Qt4 this was handled transparently when getting keysym from XLookupString. When ctrl modifier was set, XLookupString performed "keysym transformation" to obtain a latin keysym. Still this did not solve the non-latin shortcut issues for all cases due to some of Xlib assumptions which could not be controled by user. This patch implements XLookupString-like behavior in lookupLatinKeysym(). It is not a 1-to-1 copy of how XLookupString perfoms latin keysym lookup, but it serves our needs just fine. lookupLatinKeysym() also handles the cases that did not work in Qt4 with XLookupString, thanks to libxkbcommon keymap query API. And lookupLatinKeysym() replaces the fragile implementation of "fallback latin key" code path in possibleKeys(). Done-with: Ruslan Nigmatullin Task-number: QTBUG-33182 Task-number: QTBUG-32274 Change-Id: I56a5b624487ca6c2c3768220301a37dac39b439a Reviewed-by: Ruslan Nigmatullin <euroelessar@yandex.ru> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* XCB: Don't trigger less specific shortcutsRuslan Nigmatullin2014-10-221-0/+12
| | | | | | | | | | Without this patch some keycodes like Ctrl+Shift+= may generate several similar key sequences like Ctrl++ and + but only more specific keys should be returned by QXcbKeyboard::possibleKeys. Task-number: QTBUG-38137 Change-Id: I23f6522eefaa3b83cfa639f76bdc6a19b450c6f9 Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com>
* Merge "Merge remote-tracking branch 'origin/5.3' into 5.4" into refs/staging/5.4Gabriel de Dietrich2014-10-181-0/+4
|\
| * Merge remote-tracking branch 'origin/5.3' into 5.4Frederik Gladhorn2014-10-141-0/+4
| |\ | | | | | | | | | Change-Id: Ic01820f2390e419a5b286643e7351e85ae032473
| | * XCB: silence warnings about possibly undefined shiftsGiuseppe D'Angelo2014-10-061-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code shifts "1" by a uint32 number. If that number is >= 32, we're triggering undefined behavior, and Coverity rightfully complains about that. Add some asserts to silence those warnings. Change-Id: Ib91085a279b0a2b7ad37afad05ec1d764c0496b1 Reviewed-by: Uli Schlachter <psychon@znc.in> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | | xcb: Fix a type of variables for xkb modifiers masksAlexander Volkov2014-10-161-2/+2
| | | | | | | | | | | | | | | | | | Change-Id: I05c7c6a649a55fc0648b1cb84e1c402160c9d998 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com>
* | | xcb: Don't return 0 as a possible key for a shortcutAlexander Volkov2014-10-161-1/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | QXcbKeyboard::keysymToQtKey() may return a value of 0 for keysyms that are not supported by Qt (e.g. for XK_ISO_Next_Group). It is then translated to an empty QKeySequence which in turn is detected as a partial match for any shortcut. The behavior of QShortcutMap::nextState() becomes broken because it sets current state to QKeySequence::PartialMatch while there is no match at all. Task-number: QTCREATORBUG-9589 Change-Id: I1e2a4511a876dfa418db9906d10382255a2e4d62 Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com> Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
* | Merge remote-tracking branch 'origin/5.3' into 5.4Gabriel de Dietrich2014-09-291-1/+3
|\| | | | | | | | | | | | | | | Conflicts: src/network/socket/qnativesocketengine_unix.cpp src/widgets/kernel/qwidget_qpa.cpp Change-Id: I6f1aa320d5ca66cd92d601a95885aeaab0abb191
| * XCB: fix a memory leakGiuseppe D'Angelo2014-09-251-1/+3
| | | | | | | | | | | | | | | | | | An early return didn't deallocate a xkb_state struct. Change-Id: I158ffc67030403636aceab985cc605888a31804b Reviewed-by: Uli Schlachter <psychon@znc.in> Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | | | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* | Merge remote-tracking branch 'origin/5.3' into 5.4Frederik Gladhorn2014-09-231-13/+14
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The isAlwaysAskOption was removed in 38621713150b663355ebeb799a5a50d8e39a3c38 so manually removed code in src/plugins/bearer/connman/qconnmanengine.cpp Conflicts: src/corelib/global/qglobal.h src/corelib/tools/qcollator_macx.cpp src/corelib/tools/qstring.cpp src/gui/kernel/qwindow.cpp src/gui/kernel/qwindow_p.h src/gui/text/qtextengine.cpp src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h src/plugins/platforms/android/qandroidinputcontext.cpp src/plugins/platforms/xcb/qglxintegration.cpp src/plugins/platforms/xcb/qglxintegration.h src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/testlib/qtestcase.cpp src/testlib/qtestlog.cpp src/widgets/dialogs/qfiledialog.cpp src/widgets/kernel/qwindowcontainer.cpp tests/auto/corelib/tools/qcollator/tst_qcollator.cpp tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp Change-Id: Ic5d4187f682257a17509f6cd28d2836c6cfe2fc8
| * xcb: use keyboard event source window to determine auto-repeat valueDyami Caliri2014-08-201-13/+14
| | | | | | | | | | | | | | | | | | | | The xcb auto-repeat checking code checks for queued events on the target (focused) window. This breaks down if you have a native child widget, and QKeyEvent::autoRepeat is never true. Task-number: QTBUG-21500 Change-Id: Ia979edfa8a3afce07a3e1cbaa778541ffb9ce5dc Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com>
* | Support multimedia keys on WindowsAllan Sandfeld Jensen2014-08-021-0/+4
|/ | | | | | | | | | | We currently do not receive events from most multimedia keys on Windows because they are sent using appcommand events instead of the normal key events. This patchs adds support for parsing appcommand events. Change-Id: I19f568b6fa0d3d136e3a22318df1499a1fab6edb Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* Translate Super/Hyper keys to MetaModifierGatis Paeglis2014-06-251-0/+9
| | | | | | | | | | | | This is how it was done in Qt4. If users are interested in an actual X11 keysym they can use QKeyEvent::nativeVirtualKey(). Change-Id: I710664e48c5db1633a357aa0a5d238f3453103ab Task-number: QTBUG-38428 Reviewed-by: Christian Stenger <christian.stenger@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sebastian Kügler <sebas@kde.org> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Don't access null pointerGatis Paeglis2014-04-081-3/+6
| | | | | Change-Id: If9ac712543f7c7fd85d877bba76e67ce89c60c61 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Consistently hide the parts that require xcb-xkbThiago Macieira2014-04-051-1/+1
| | | | | | | | It was inconsistent. This also solves a warning from Clang 3.4: error: private field 'vmod_masks' is not used [-Werror,-Wunused-private-field] Change-Id: I6be9f7ef56dffe6df2be3beb984c2d82d3808403 Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com>
* Fix regression in key handling.Gatis Paeglis2014-04-031-11/+8
| | | | | | | | | | | | | | | | | libxkbcommon 0.4.1 added two new functions, xkb_state_key_get_utf{8,32}(). They combine the operations of xkb_state_key_get_syms() and xkb_keysym_to_utf{8,32}(). The xkb_state_key_get_utf{8,32}() functions now apply Control transformation: when the Control modifier is active, the string is converted to an appropriate control character. This matches the behavior of libX11's XLookupString(3), and is required by the XKB specification: http://www.x.org/releases/current/doc/kbproto/xkbproto.html#Interpreting_the_Control_Modifier Task-number: QTBUG-36281 Change-Id: Ib45f45d801291c171640600384107a35d7d56b9b Reviewed-by: Ran Benita <ran234@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [xcb] Fix build failureGatis Paeglis2014-04-021-19/+9
| | | | | | | | | | | | | | | | | | | | | | Build failure was introduced by 9bb634a6176c639bd6b52d58151e9927c30919d0. When linking with systems provided libxkbcommon, then DFLT_XKB_CONFIG_ROOT can't be accessed directly. The reason that this slip through CI is that on CI machines Qt is build with bundled version of libxkbcommon. In addition this patch improves keymap error message, by making it more explicit for users what could be the reasons for "keymap compilation" failures and what should be done to make input work. As it turns out this is a common issue on old systems, servers and some VNC clients. Task-number: QTBUG-37971 Change-Id: I77667a404150ee7ab8465a065e23ca5eea63c33b Reviewed-by: Uli Schlachter <psychon@znc.in> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Improve keymap error handlingGatis Paeglis2014-03-271-17/+60
| | | | | | | | | | | - add QT_XKB_CONFIG_ROOT envvar, this can be used to provide an alternative XKB configuration search paths (default XKB configuration root is detected when building Qt library). At runtime these paths might change - when dropping Qt application binary into a system with different setup. Change-Id: Ia21a3e7f0339c95793c1f543d1a95b1591e5d8df Reviewed-by: Uli Schlachter <psychon@znc.in> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add better support for keymap update handlingGatis Paeglis2014-03-271-133/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | Use the new X11 support API xkb_x11_* released in libxkbcommon version 0.4.0. From the commit message where this API was introduced: "These are function to create an xkb_keymap directly from XKB requests to the X server. This opens up the possibility for X clients to use xcb + xcb-xkb + xkbcommon as a proper replacement for Xlib + xkbfile for keyboard support. Why not just use the RMLVO that the server puts in the _XKB_RULES_NAMES property? This does not account for custom keymaps, on-the-fly keymap modifications, remote clients, etc., so is not a proper solution in practice. Also, some servers don't even set it. Now, the client just needs to recreate the keymap in response to a change in the server's keymap (as Xlib clients do with XRefreshKeyboardMapping() and friends)." This patch moves XKEYBOARD presence decision from compile time to runtime for a proper remote X client support. Task-number: QTBUG-31527 Task-number: QTBUG-32760 Change-Id: I4d402668cda2126ef180b27022154f96b1874b1d Reviewed-by: Uli Schlachter <psychon@znc.in> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Update bundled libxkbcommon version to 0.4.0Gatis Paeglis2014-03-191-20/+0
| | | | | | | | | | | | | This release comes with important bug fixes. Also we can now remove the workaround code which was needed for libxkbcommon 0.2.0. Task-number: QTBUG-31712 Task-number: QTBUG-33732 Task-number: QTBUG-34056 Change-Id: I57caf7f803b9a01a15541a5ad82e464de3b8abbb Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* expand tabs and related whitespace fixes in *.{cpp,h,qdoc}Oswald Buddenhagen2014-01-131-48/+48
| | | | | | | | the diff -w for this commit is empty. Started-by: Thiago Macieira <thiago.macieira@intel.com> Change-Id: I77bb84e71c63ce75e0709e5b94bee18e3ce6ab9e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-08-141-40/+72
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure mkspecs/macx-xcode/Info.plist.app mkspecs/macx-xcode/Info.plist.lib qmake/doc/qmake.qdocconf src/corelib/global/qglobal.h tests/auto/other/exceptionsafety/exceptionsafety.pro tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp Change-Id: I3c769a4a82dc2e99a12c69123fbf17613fd2ac2a
| * Merge branch 'release' into stableSergio Ahumada2013-08-091-21/+48
| |\ | | | | | | | | | Change-Id: I5e94c4f01564df633c9925561ebb0b553bd31a2e
| | * Fix handling of non-latin1 shortcutsGatis Paeglis2013-07-311-21/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch enables non-latin1 shortcut handling on Qt5/X11. Task-number: QTBUG-32274 Change-Id: Ia084258b956128ffade8eddfbcb18af334d79a59 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * | Fix stuck modifier issue in the non-xcb_xkb code pathGatis Paeglis2013-08-021-19/+24
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since updating the xkb_state throght core events is more tricky (opposed to the xcb-xkb code path) where we have to use xkb_state_update_key, we need to make sure that our local state is in sync with the X server's state. The local state was getting out of sync if key was pressed down in a Qt application and released in other X client (by changing the focus to another window with a mouse, for example). Task-number: QTBUG-32660 Change-Id: I662bf5aad3ab0e8591109994e746d85ff61ad6ef Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Merge branch 'stable' into devSergio Ahumada2013-07-111-1/+34
|\| | | | | | | | | | | | | | | | | | | Conflicts: qmake/generators/mac/pbuilder_pbx.cpp src/corelib/json/qjsonwriter.cpp src/corelib/kernel/qeventdispatcher_blackberry.cpp src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm Change-Id: I24df576c4cbd18fa51b03122f71e32bb83b9028f
| * Resolve modifier mask conflicts on X11Gatis Paeglis2013-07-071-1/+34
| | | | | | | | | | | | | | | | | | | | | | On X11 key codes and modifiers can have many-to-many relationship, i.e. a key can activate several modifiers, and a modifier may be activated by several keys. This patch handles these cases, the logic is borrowed from Qt4. Task-number: QTBUG-31572 Change-Id: Ide4eb890ec723c68afafe0576d8285440a47d7b0 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Key mappings for more remote-control keysAllan Sandfeld Jensen2013-07-051-0/+8
|/ | | | | | | | | | | | We are missing a few key mappings to have support for remote control keys supported by Android and DirectFB. This patch adds the four color keys Red/Green/Yellow/Blue and ChannelUp and ChannelDown. Change-Id: I4d859c28e0d61c5362f1212ba1e577a47de86ec1 Reviewed-by: BogDan Vatra <bogdan@kde.org> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Merge remote-tracking branch 'origin/release' into stableFrederik Gladhorn2013-06-201-0/+2
|\ | | | | | | Change-Id: I94bb158562ae6b80a87b40139d7302ea7b9b9aa8
| * Android Mute and FastForward keys mapped wrongAllan Sandfeld Jensen2013-06-171-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | KEYCODE_MEDIA_FAST_FORWARD is mapped to Qt::Key_Forward, which undoes Back. I believe the best match in Qt would be Qt::Key_AudioForward which is also mapped by XCB from XF86XK_AudioForward /* fast-forward audio track */ KEYCODE_MUTE is mapped to Qt::Key_Volume_Mute, but the mute button is for muting the microphone, the volume mute is called KEYCODE_VOLUME_MUTE. Change-Id: Id0b78c9bde78faef1f5d31019693e6c466941d70 Reviewed-by: BogDan Vatra <bogdan@kde.org>
* | Make qtbase compile with QT_NO_TEXTCODECTasuku Suzuki2013-06-171-1/+7
|/ | | | | Change-Id: I1614dc08c0dd1950020e415f37c97160431b2336 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Fix ambiguity in shortcut matchingGatis Paeglis2013-05-201-10/+13
| | | | | | | | | | | Comparing to the Qt4 implementation, possibleKeys() should skip records where qtKeys are equal. Task-number: QTBUG-31132 Change-Id: I2fb073b4dc7291f909cce616f40f7c2491e7cf26 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com> Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
* Make access to xkbcommon_workaround.h more genericGatis Paeglis2013-05-071-1/+21
| | | | | | | | | | It makes more sense to keep this workaround header together with the other libxkbcommon files for a better access point since it's used by several *.pro files. Change-Id: I63d4eb58f6e7f3852834e41c4b6e058a2c962233 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Use X11 core protocol when xkb not availableGatis Paeglis2013-05-071-12/+160
| | | | | | | | | | | | | | | | | | | | To have a properly working key input in the xcb plugin in the case when xcb-xkb library is not available we can update the xkb_state struct with the keyboard state information available in the X11 core events. The current modifier state is reported to clients in a number of core protocol events and can be determined using the QueryPointer request. This is how it is done in Weston, Wayland's reference implementation. Note: In case the X server doesn't have a xkb support on it (which is very unlikely), then xkbcommon will only pick up the user's primary layout. The X server with the xkb support stuffs unused bits (13 and 14) of 'state' in the core events with the effective keyboard group, which we can use to determine layout changes. Change-Id: I9f1ef635109870e7412ef1157ca592f3c8f9271c Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Added possibleKeys(QKeyEvent *) to QXcbIntegrationGatis Paeglis2013-05-071-0/+83
| | | | | | | | | | | | | | This is required for a modifier+key shortcut support. Also fixes old Qt bug when keymap group changes were not handled properly for shortcut functionality. Task-number: QTBUG-26902 Task-number: QTBUG-4845 Change-Id: I04d2c2ad7049df7420999816154605848fa670e1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Utilize libxkbcommon API for the keyboard backend on X11Gatis Paeglis2013-05-071-401/+326
| | | | | | | | | | | | | | | | | | | | | | | | | | | libxkbcommon is a keymap compiler [1] which utilizes xkb keyboard configuration database [2]. xkbcommon simplifies keyboard state handling by providing xkb_state object which holds the current state of all modifiers, groups, LEDs, etc, relating to the provided keymap. Detecting modifier mapping should become simpler once it gets supported in libxkbcommon. Also with xinput2 we could get rid of the XkbStateNotify events, because xinput2 key press/release already include all the mod/group info. [1] http://xkbcommon.org/ [2] http://www.freedesktop.org/wiki/Software/XKeyboardConfig This patch: - Removes a dependency to -lxcb-keysyms - Removes a dependency to XLib call - XLookupString - Enables required functionality to fix QTBUG-27681 Task-number: QTBUG-27680 Change-Id: I10e10f873821ee02f6df72238e215a541150f38f Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>