File indexing completed on 2024-11-10 04:57:01
0001 /* 0002 KWin - the KDE window manager 0003 This file is part of the KDE project. 0004 0005 SPDX-FileCopyrightText: 2015 Martin Gräßlin <mgraesslin@kde.org> 0006 0007 SPDX-License-Identifier: GPL-2.0-or-later 0008 */ 0009 #pragma once 0010 0011 #include <kglobalaccel_interface.h> 0012 0013 #include <QObject> 0014 0015 class KGlobalAccelImpl : public KGlobalAccelInterface 0016 { 0017 Q_OBJECT 0018 Q_PLUGIN_METADATA(IID KGlobalAccelInterface_iid FILE "kwin.json") 0019 Q_INTERFACES(KGlobalAccelInterface) 0020 0021 public: 0022 KGlobalAccelImpl(QObject *parent = nullptr); 0023 ~KGlobalAccelImpl() override; 0024 0025 bool grabKey(int key, bool grab) override; 0026 void setEnabled(bool) override; 0027 0028 public Q_SLOTS: 0029 bool checkKeyPressed(int keyQt); 0030 bool checkKeyReleased(int keyQt); 0031 0032 private: 0033 bool m_shuttingDown = false; 0034 QMetaObject::Connection m_inputDestroyedConnection; 0035 };