KWin
Loading...
Searching...
No Matches
kglobalaccel_plugin.h
Go to the documentation of this file.
1/*
2 KWin - the KDE window manager
3 This file is part of the KDE project.
4
5 SPDX-FileCopyrightText: 2015 Martin Gräßlin <mgraesslin@kde.org>
6
7 SPDX-License-Identifier: GPL-2.0-or-later
8*/
9#pragma once
10
11#include <kglobalaccel_interface.h>
12
13#include <QObject>
14
15class KGlobalAccelImpl : public KGlobalAccelInterface
16{
17 Q_OBJECT
18 Q_PLUGIN_METADATA(IID KGlobalAccelInterface_iid FILE "kwin.json")
19 Q_INTERFACES(KGlobalAccelInterface)
20
21public:
22 KGlobalAccelImpl(QObject *parent = nullptr);
24
25 bool grabKey(int key, bool grab) override;
26 void setEnabled(bool) override;
27
28public Q_SLOTS:
29 bool checkKeyPressed(int keyQt);
30 bool checkKeyReleased(int keyQt);
31
32private:
33 bool m_shuttingDown = false;
34 QMetaObject::Connection m_inputDestroyedConnection;
35};
bool checkKeyReleased(int keyQt)
bool grabKey(int key, bool grab) override
bool checkKeyPressed(int keyQt)
~KGlobalAccelImpl() override
KGlobalAccelImpl(QObject *parent=nullptr)
void setEnabled(bool) override