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
qplatformkeymapper.cpp
Go to the documentation of this file.
1// Copyright (C) 2023 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
5
6#include <private/qguiapplication_p.h>
7#include <qpa/qplatformintegration.h>
8
10
11Q_LOGGING_CATEGORY(lcQpaKeyMapper, "qt.qpa.keymapper")
12
16
17/*
18 Should return a list of possible key combinations for the given key event.
19
20 For example, given a US English keyboard layout, the key event Shift+5
21 can represent both a "Shift+5" key combination, as well as just "%".
22*/
24{
25 auto *platformIntegration = QGuiApplicationPrivate::platformIntegration();
26 QList<int> possibleKeys = platformIntegration->possibleKeys(event);
27 QList<QKeyCombination> combinations;
28 for (int key : possibleKeys)
29 combinations << QKeyCombination::fromCombined(key);
30 return combinations;
31}
32
33Qt::KeyboardModifiers QPlatformKeyMapper::queryKeyboardModifiers() const
34{
35 return QGuiApplicationPrivate::platformIntegration()->queryKeyboardModifiers();
36}
37
static QPlatformIntegration * platformIntegration()
static constexpr QKeyCombination fromCombined(int combined)
The QKeyEvent class describes a key event.
Definition qevent.h:424
virtual Qt::KeyboardModifiers queryKeyboardModifiers() const
virtual QList< QKeyCombination > possibleKeyCombinations(const QKeyEvent *event) const
Combined button and popup list for selecting options.
#define Q_LOGGING_CATEGORY(name,...)
GLuint64 key
struct _cl_event * event