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
qwaylandqtkey.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include "qwaylandqtkey_p.h"
6#include "qwaylanddisplay_p.h"
7
9
10namespace QtWaylandClient {
11
13 : QtWayland::zqt_key_v1(display->wl_registry(), id, 1)
14 , m_display(display)
15{
16}
17
19{
20 zqt_key_v1_destroy(object());
21}
22
23void QWaylandQtKeyExtension::zqt_key_v1_key(struct wl_surface *surface,
24 uint32_t time,
25 uint32_t type,
26 uint32_t key,
27 uint32_t modifiers,
28 uint32_t nativeScanCode,
29 uint32_t nativeVirtualKey,
30 uint32_t nativeModifiers,
31 const QString &text,
32 uint32_t autorep,
33 uint32_t count)
34{
35 QList<QWaylandInputDevice *> inputDevices = m_display->inputDevices();
36 if (!surface && inputDevices.isEmpty()) {
37 qWarning("qt_key_extension: handle_qtkey: No input device");
38 return;
39 }
40
41 QWaylandInputDevice *dev = inputDevices.first();
42
43 auto *win = surface ? QWaylandWindow::fromWlSurface(surface) : nullptr;
44
45 if (!win)
46 win = dev->keyboardFocus();
47
48 if (!win || !win->window()) {
49 qWarning("qt_key_extension: handle_qtkey: No keyboard focus");
50 return;
51 }
52
55 nativeScanCode, nativeVirtualKey, nativeModifiers, text,
56 autorep, count);
57}
58
59}
60
Type
This enum type defines the valid event types in Qt.
Definition qcoreevent.h:51
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
QWidget * window() const
Returns the window for this widget, i.e.
Definition qwidget.cpp:4313
static bool handleExtendedKeyEvent(QWindow *window, QEvent::Type type, int key, Qt::KeyboardModifiers modifiers, quint32 nativeScanCode, quint32 nativeVirtualKey, quint32 nativeModifiers, const QString &text=QString(), bool autorep=false, ushort count=1)
\inmodule QtGui
Definition qwindow.h:63
QList< QWaylandInputDevice * > inputDevices() const
void zqt_key_v1_key(struct wl_surface *surface, uint32_t time, uint32_t type, uint32_t key, uint32_t modifiers, uint32_t nativeScanCode, uint32_t nativeVirtualKey, uint32_t nativeModifiers, const QString &text, uint32_t autorep, uint32_t count) override
QWaylandQtKeyExtension(QWaylandDisplay *display, uint32_t id)
static QWaylandWindow * fromWlSurface(::wl_surface *surface)
EGLImageKHR int int EGLuint64KHR * modifiers
QString text
struct wl_display * display
Definition linuxdmabuf.h:41
Combined button and popup list for selecting options.
#define qWarning
Definition qlogging.h:166
GLuint64 key
GLenum GLuint id
[7]
GLenum GLenum GLsizei count
GLenum type
QWidget * win
Definition settings.cpp:6
aWidget window() -> setWindowTitle("New Window Title")
[2]