summaryrefslogtreecommitdiffstats
path: root/tests/auto/compositor/compositor/testkeyboardgrabber.cpp
blob: 73592dd4f050ba8ab486318c670b85f70835a405 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright (C) 2016 LG Electronics, Inc., author: <mikko.levonmaa@lge.com>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

#include "testkeyboardgrabber.h"

TestKeyboardGrabber::TestKeyboardGrabber(QWaylandSeat *seat)
    : QWaylandKeyboard(seat)
{
}

void TestKeyboardGrabber::setFocus(QWaylandSurface *surface)
{
    Q_EMIT focusedCalled();
    QWaylandKeyboard::setFocus(surface);
}

void TestKeyboardGrabber::sendKeyPressEvent(uint code)
{
    Q_EMIT keyPressCalled();
    QWaylandKeyboard::sendKeyPressEvent(code);
}

void TestKeyboardGrabber::sendKeyReleaseEvent(uint code)
{
    Q_EMIT keyReleaseCalled();
    QWaylandKeyboard::sendKeyReleaseEvent(code);
}

void TestKeyboardGrabber::sendKeyModifiers(QWaylandClient *client, uint32_t serial)
{
    Q_EMIT modifiersCalled();
    QWaylandKeyboard::sendKeyModifiers(client, serial);
}