Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qwlqtkey.cpp
Go to the documentation of this file.
1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#include "qwlqtkey_p.h"
5#include <QtWaylandCompositor/QWaylandSurface>
6#include <QKeyEvent>
7#include <QWindow>
8
10
11namespace QtWayland {
12
19
21{
22 uint32_t time = m_compositor->currentTimeMsecs();
23
24 Resource *target = surface ? resourceMap().value(surface->waylandClient()) : 0;
25
26 if (target) {
27 send_key(target->handle,
28 surface ? surface->resource() : nullptr,
29 time, event->type(), event->key(), event->modifiers(),
30 event->nativeScanCode(),
31 event->nativeVirtualKey(),
32 event->nativeModifiers(),
33 event->text(),
34 event->isAutoRepeat(),
35 event->count());
36
37 return true;
38 }
39
40 return false;
41}
42
43}
44
46
47#include "moc_qwlqtkey_p.cpp"
The QKeyEvent class describes a key event.
Definition qevent.h:424
\qmltype WaylandCompositor \instantiates QWaylandCompositor \inqmlmodule QtWayland....
\qmltype WaylandSurface \instantiates QWaylandSurface \inqmlmodule QtWayland.Compositor
struct wl_resource * resource() const
Returns the Wayland resource corresponding to this QWaylandSurface.
::wl_client * waylandClient() const
Holds the wl_client using this QWaylandSurface.
bool postQtKeyEvent(QKeyEvent *event, QWaylandSurface *surface)
Definition qwlqtkey.cpp:20
QtKeyExtensionGlobal(QWaylandCompositor *compositor)
Definition qwlqtkey.cpp:13
struct wl_display * display
Definition linuxdmabuf.h:41
Combined button and popup list for selecting options.
static QOpenGLCompositor * compositor
GLenum target
struct _cl_event * event