summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qplatformkeymapper.cpp
blob: f54e4ff3794ad8f1c9a5dfea9fb1ce8dffa4a0c6 (plain)
1234567891011121314151617181920212223242526272829303132333435363738
// Copyright (C) 2023 The Qt Company Ltd.// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only#include"qplatformkeymapper.h"#include <private/qguiapplication_p.h>#include <qpa/qplatformintegration.h> QT_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcQpaKeyMapper,"qt.qpa.keymapper")QPlatformKeyMapper::~QPlatformKeyMapper(){}/* Should return a list of possible key combinations for the given key event. For example, given a US English keyboard layout, the key event Shift+5 can represent both a "Shift+5" key combination, as well as just "%".*/ QList<QKeyCombination>QPlatformKeyMapper::possibleKeyCombinations(const QKeyEvent *event)const{auto*platformIntegration =QGuiApplicationPrivate::platformIntegration(); QList<int> possibleKeys = platformIntegration->possibleKeys(event); QList<QKeyCombination> combinations;for(int key : possibleKeys) combinations <<QKeyCombination::fromCombined(key);return combinations;}Qt::KeyboardModifiers QPlatformKeyMapper::queryKeyboardModifiers()const{returnQGuiApplicationPrivate::platformIntegration()->queryKeyboardModifiers();} QT_END_NAMESPACE 
close