summaryrefslogtreecommitdiffstats
path: root/src/compositor/compositor_api/qwaylandkeyboard.cpp
diff options
context:
space:
mode:
authorGiulio Camuffo <giulio.camuffo@kdab.com>2017-03-01 12:12:55 +0100
committerGiulio Camuffo <giulio.camuffo@kdab.com>2017-03-08 17:00:54 +0000
commit3d8b3113c2349b5e002ece39ff20118b471aac6e (patch)
tree7c00902e9c8b96c362a79c10835eea4b119ec47b /src/compositor/compositor_api/qwaylandkeyboard.cpp
parent7d527c1914710a511c06713bbda1572b767cea34 (diff)
Fix build when xkbcommon is disabled
Change-Id: I0ec7a5aa8300e796b015c0d995e71ebf77727bbd Task-number: QTBUG-58839 Reviewed-by: Jan Arne Petersen <jan.petersen@kdab.com> Reviewed-by: Yong Bakos <junk@humanoriented.com> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'src/compositor/compositor_api/qwaylandkeyboard.cpp')
-rw-r--r--src/compositor/compositor_api/qwaylandkeyboard.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/compositor/compositor_api/qwaylandkeyboard.cpp b/src/compositor/compositor_api/qwaylandkeyboard.cpp
index 55381b450..986f819ff 100644
--- a/src/compositor/compositor_api/qwaylandkeyboard.cpp
+++ b/src/compositor/compositor_api/qwaylandkeyboard.cpp
@@ -175,7 +175,11 @@ void QWaylandKeyboardPrivate::keyboard_release(wl_keyboard::Resource *resource)
void QWaylandKeyboardPrivate::keyEvent(uint code, uint32_t state)
{
+#if QT_CONFIG(xkbcommon_evdev)
uint key = toWaylandXkbV1Key(code);
+#else
+ uint key = code;
+#endif
if (state == WL_KEYBOARD_KEY_STATE_PRESSED) {
keys << key;
} else {
@@ -187,7 +191,11 @@ void QWaylandKeyboardPrivate::sendKeyEvent(uint code, uint32_t state)
{
uint32_t time = compositor()->currentTimeMsecs();
uint32_t serial = compositor()->nextSerial();
+#if QT_CONFIG(xkbcommon_evdev)
uint key = toWaylandXkbV1Key(code);
+#else
+ uint key = code;
+#endif
if (focusResource)
send_key(focusResource->handle, serial, time, key, state);
}