summaryrefslogtreecommitdiffstats
path: root/src/client/qwaylandinputdevice_p.h
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2019-05-07 03:01:52 +0200
committerJohan Klokkhammer Helsing <johan.helsing@qt.io>2019-05-07 12:39:12 +0200
commit17b1705ce4c8bc9ca19a6b424a00a045134b3aac (patch)
tree03e7b7d461064dd007179cd29da9c024e6c8f190 /src/client/qwaylandinputdevice_p.h
parent4ab3cbcc5c4da6384e9081993c5ba24303a382bd (diff)
parenta658a10f6a42e67bd762f87851c23cc1c1e3b141 (diff)
Merge remote-tracking branch 'origin/5.13' into dev
Conflicts: src/client/qwaylanddisplay_p.h src/client/qwaylandwindow.cpp Change-Id: I50eb5c83a8b81e4bdb032b68d41f429b17d0a74d
Diffstat (limited to 'src/client/qwaylandinputdevice_p.h')
-rw-r--r--src/client/qwaylandinputdevice_p.h56
1 files changed, 28 insertions, 28 deletions
diff --git a/src/client/qwaylandinputdevice_p.h b/src/client/qwaylandinputdevice_p.h
index 404bcf571..f44f1ab1f 100644
--- a/src/client/qwaylandinputdevice_p.h
+++ b/src/client/qwaylandinputdevice_p.h
@@ -54,6 +54,7 @@
#include <QtWaylandClient/private/qtwaylandclientglobal_p.h>
#include <QtWaylandClient/private/qwaylandwindow_p.h>
+#include <QtCore/QScopedPointer>
#include <QSocketNotifier>
#include <QObject>
#include <QTimer>
@@ -64,8 +65,7 @@
#include <QtWaylandClient/private/qwayland-wayland.h>
#if QT_CONFIG(xkbcommon)
-#include <xkbcommon/xkbcommon.h>
-#include <xkbcommon/xkbcommon-keysyms.h>
+#include <QtXkbCommonSupport/private/qxkbcommon_p.h>
#endif
#include <QtCore/QDebug>
@@ -76,11 +76,6 @@
struct wl_cursor_image;
#endif
-#if QT_CONFIG(xkbcommon)
-struct xkb_compose_state;
-struct xkb_compose_table;
-#endif
-
QT_BEGIN_NAMESPACE
namespace QtWaylandClient {
@@ -130,6 +125,8 @@ public:
QWaylandWindow *keyboardFocus() const;
QWaylandWindow *touchFocus() const;
+ QList<int> possibleKeys(const QKeyEvent *event) const;
+
QPointF pointerSurfacePosition() const;
Qt::KeyboardModifiers modifiers() const;
@@ -166,7 +163,7 @@ private:
Pointer *mPointer = nullptr;
Touch *mTouch = nullptr;
- QWaylandTextInput *mTextInput = nullptr;
+ QScopedPointer<QWaylandTextInput> mTextInput;
uint32_t mTime = 0;
uint32_t mSerial = 0;
@@ -215,41 +212,44 @@ public:
QWaylandInputDevice *mParent = nullptr;
::wl_surface *mFocus = nullptr;
-#if QT_CONFIG(xkbcommon)
- xkb_context *mXkbContext = nullptr;
- xkb_keymap *mXkbMap = nullptr;
- xkb_state *mXkbState = nullptr;
- xkb_compose_table *mXkbComposeTable = nullptr;
- xkb_compose_state *mXkbComposeState = nullptr;
-#endif
+
uint32_t mNativeModifiers = 0;
- int mRepeatKey;
- uint32_t mRepeatCode;
- uint32_t mRepeatTime;
+ struct repeatKey {
+ int key;
+ uint32_t code;
+ uint32_t time;
+ QString text;
+ Qt::KeyboardModifiers modifiers;
+ uint32_t nativeVirtualKey;
+ uint32_t nativeModifiers;
+ } mRepeatKey;
+
+ QTimer mRepeatTimer;
int mRepeatRate = 25;
int mRepeatDelay = 400;
- QString mRepeatText;
-#if QT_CONFIG(xkbcommon)
- xkb_keysym_t mRepeatSym;
-#endif
- QTimer mRepeatTimer;
+
+ uint32_t mKeymapFormat = WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1;
Qt::KeyboardModifiers modifiers() const;
private slots:
- void repeatKey();
void handleFocusDestroyed();
void handleFocusLost();
private:
#if QT_CONFIG(xkbcommon)
- bool createDefaultKeyMap();
- void releaseKeyMap();
- void createComposeState();
- void releaseComposeState();
+ bool createDefaultKeymap();
#endif
+ void handleKey(ulong timestamp, QEvent::Type type, int key, Qt::KeyboardModifiers modifiers,
+ quint32 nativeScanCode, quint32 nativeVirtualKey, quint32 nativeModifiers,
+ const QString &text, bool autorepeat = false, ushort count = 1);
+#if QT_CONFIG(xkbcommon)
+ QXkbCommon::ScopedXKBKeymap mXkbKeymap;
+ QXkbCommon::ScopedXKBState mXkbState;
+#endif
+ friend class QWaylandInputDevice;
};
class Q_WAYLAND_CLIENT_EXPORT QWaylandInputDevice::Pointer : public QObject, public QtWayland::wl_pointer