summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/input/libinput/qlibinputkeyboard.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2018-12-04 09:58:43 +0100
committerLiang Qi <liang.qi@qt.io>2018-12-04 09:58:43 +0100
commit5d5c00c67682bce105197b659687fd1fee8f60cf (patch)
tree686e41dc3ea121235fb73afb9157ed603f1bfeff /src/platformsupport/input/libinput/qlibinputkeyboard.cpp
parentf213e818f03d35cb82e3daf187415197fd156f8e (diff)
parentb82559244e2dc03f1ceff66bb67630df4300dc7c (diff)
Merge remote-tracking branch 'origin/5.12' into dev
Conflicts: src/gui/painting/qdrawhelper.cpp Change-Id: I4916e07b635e1d3830e9b46ef7914f99bec3098e
Diffstat (limited to 'src/platformsupport/input/libinput/qlibinputkeyboard.cpp')
-rw-r--r--src/platformsupport/input/libinput/qlibinputkeyboard.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/platformsupport/input/libinput/qlibinputkeyboard.cpp b/src/platformsupport/input/libinput/qlibinputkeyboard.cpp
index 2524066301..baef769bc9 100644
--- a/src/platformsupport/input/libinput/qlibinputkeyboard.cpp
+++ b/src/platformsupport/input/libinput/qlibinputkeyboard.cpp
@@ -44,7 +44,7 @@
#include <QtGui/private/qinputdevicemanager_p.h>
#include <qpa/qwindowsysteminterface.h>
#include <libinput.h>
-#ifndef QT_NO_XKBCOMMON_EVDEV
+#if QT_CONFIG(xkbcommon)
#include <xkbcommon/xkbcommon-keysyms.h>
#include <xkbcommon/xkbcommon-names.h>
#endif
@@ -56,7 +56,7 @@ Q_DECLARE_LOGGING_CATEGORY(qLcLibInput)
const int REPEAT_DELAY = 500;
const int REPEAT_RATE = 100;
-#ifndef QT_NO_XKBCOMMON_EVDEV
+#if QT_CONFIG(xkbcommon)
struct KeyTabEntry {
int xkbkey;
int qtkey;
@@ -132,14 +132,14 @@ static const KeyTabEntry keyTab[] = {
#endif
QLibInputKeyboard::QLibInputKeyboard()
-#ifndef QT_NO_XKBCOMMON_EVDEV
+#if QT_CONFIG(xkbcommon)
: m_ctx(0),
m_keymap(0),
m_state(0),
m_mods(Qt::NoModifier)
#endif
{
-#ifndef QT_NO_XKBCOMMON_EVDEV
+#if QT_CONFIG(xkbcommon)
qCDebug(qLcLibInput) << "Using xkbcommon for key mapping";
m_ctx = xkb_context_new(XKB_CONTEXT_NO_FLAGS);
if (!m_ctx) {
@@ -164,13 +164,13 @@ QLibInputKeyboard::QLibInputKeyboard()
m_repeatTimer.setSingleShot(true);
connect(&m_repeatTimer, &QTimer::timeout, this, &QLibInputKeyboard::handleRepeat);
#else
- qCWarning(qLcLibInput) << "X-less xkbcommon not available, not performing key mapping";
+ qCWarning(qLcLibInput) << "xkbcommon not available, not performing key mapping";
#endif
}
QLibInputKeyboard::~QLibInputKeyboard()
{
-#ifndef QT_NO_XKBCOMMON_EVDEV
+#if QT_CONFIG(xkbcommon)
if (m_state)
xkb_state_unref(m_state);
if (m_keymap)
@@ -182,7 +182,7 @@ QLibInputKeyboard::~QLibInputKeyboard()
void QLibInputKeyboard::processKey(libinput_event_keyboard *e)
{
-#ifndef QT_NO_XKBCOMMON_EVDEV
+#if QT_CONFIG(xkbcommon)
if (!m_ctx || !m_keymap || !m_state)
return;
@@ -245,7 +245,7 @@ void QLibInputKeyboard::processKey(libinput_event_keyboard *e)
#endif
}
-#ifndef QT_NO_XKBCOMMON_EVDEV
+#if QT_CONFIG(xkbcommon)
void QLibInputKeyboard::handleRepeat()
{
QWindowSystemInterface::handleExtendedKeyEvent(nullptr, QEvent::KeyPress,