summaryrefslogtreecommitdiffstats
path: root/tests/auto/client/shared/coreprotocol.h
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2018-12-13 09:39:05 +0100
committerJohan Helsing <johan.helsing@qt.io>2019-01-30 14:35:10 +0000
commit276b15fa355ce3a2e92b307d340f2367ccac1843 (patch)
tree3d53bb231244740fe7e91e3a7da34605f72f0fc8 /tests/auto/client/shared/coreprotocol.h
parentd0063d0972b29e9a2d4bdff837e3d4c23ac2e6cc (diff)
Client tests: Add simple test for keyboard press
Change-Id: Ib28be5277af9145834c7808f993c747e21845616 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'tests/auto/client/shared/coreprotocol.h')
-rw-r--r--tests/auto/client/shared/coreprotocol.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/auto/client/shared/coreprotocol.h b/tests/auto/client/shared/coreprotocol.h
index 565ae66ae..da171c202 100644
--- a/tests/auto/client/shared/coreprotocol.h
+++ b/tests/auto/client/shared/coreprotocol.h
@@ -38,6 +38,7 @@ namespace MockCompositor {
class WlCompositor;
class Output;
class Pointer;
+class Keyboard;
class CursorRole;
class ShmPool;
class ShmBuffer;
@@ -245,6 +246,9 @@ public:
Pointer* m_pointer = nullptr;
QVector<Pointer *> m_oldPointers;
+ Keyboard* m_keyboard = nullptr;
+ QVector<Keyboard *> m_oldKeyboards;
+
uint m_capabilities = 0;
protected:
@@ -254,7 +258,7 @@ protected:
}
void seat_get_pointer(Resource *resource, uint32_t id) override;
-// void seat_get_keyboard(Resource *resource, uint32_t id) override;
+ void seat_get_keyboard(Resource *resource, uint32_t id) override;
// void seat_get_touch(Resource *resource, uint32_t id) override;
// void seat_release(Resource *resource) override;
@@ -294,6 +298,18 @@ public:
Surface *m_surface = nullptr;
};
+class Keyboard : public QObject, public QtWaylandServer::wl_keyboard
+{
+ Q_OBJECT
+public:
+ explicit Keyboard(Seat *seat) : m_seat(seat) {}
+ //TODO: Keymap event
+ uint sendEnter(Surface *surface);
+ uint sendLeave(Surface *surface);
+ uint sendKey(wl_client *client, uint key, uint state);
+ Seat *m_seat = nullptr;
+};
+
class Shm : public Global, public QtWaylandServer::wl_shm
{
Q_OBJECT