DtkWidget
DTK Widget module
载入中...
搜索中...
未找到
dkeyboardmonitor.h
1// SPDX-FileCopyrightText: 2011 - 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef KEYBOARDMONITOR_H
6#define KEYBOARDMONITOR_H
7
8#include <QThread>
9#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
10#include <QX11Info>
11#else
12#include <QtGui/private/qtx11extras_p.h>
13#endif
14#include <dtkwidget_global.h>
15
16DWIDGET_BEGIN_NAMESPACE
17
18class DKeyboardMonitor : public QThread
19{
20 Q_OBJECT
21
22public:
23 static DKeyboardMonitor *instance();
24
25 bool isCapslockOn();
26 bool isNumlockOn();
27 bool setNumlockStatus(const bool &on);
28
29Q_SIGNALS:
30 void capslockStatusChanged(bool on);
31 void numlockStatusChanged(bool on);
32
33protected:
34 void run() Q_DECL_OVERRIDE;
35
36private:
38
39 int listen(Display *display);
40};
41
42DWIDGET_END_NAMESPACE
43
44#endif // KEYBOARDMONITOR_H
Definition dkeyboardmonitor.h:19