Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
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// Qt-Security score:significant reason:default
4
6
7#include <private/qguiapplication_p.h>
8#include <qpa/qplatformintegration.h>
9
11
12Q_LOGGING_CATEGORY(lcQpaKeyMapper, "qt.qpa.keymapper")
13
14QPlatformKeyMapper::~QPlatformKeyMapper()
15{
16}
17
18/*
19 Should return a list of possible key combinations for the given key event.
20
21 For example, given a US English keyboard layout, the key event Shift+5
22 can represent both a "Shift+5" key combination, as well as just "%".
23*/
24QList<QKeyCombination> QPlatformKeyMapper::possibleKeyCombinations(const QKeyEvent *event) const
25{
26 auto *platformIntegration = QGuiApplicationPrivate::platformIntegration();
27 QList<int> possibleKeys = platformIntegration->possibleKeys(event);
28 QList<QKeyCombination> combinations;
29 for (int key : possibleKeys)
30 combinations << QKeyCombination::fromCombined(key);
31 return combinations;
32}
33
34Qt::KeyboardModifiers QPlatformKeyMapper::queryKeyboardModifiers() const
35{
36 return QGuiApplicationPrivate::platformIntegration()->queryKeyboardModifiers();
37}
38
39QT_END_NAMESPACE
Combined button and popup list for selecting options.