KGuiAddons

kmodifierkeyinfoprovider_xcb.h
1/*
2 SPDX-FileCopyrightText: 2009 Michael Leupold <lemma@confuego.org>
3 SPDX-FileCopyrightText: 2013 Martin Gräßlin <mgraesslin@kde.org>
4
5 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
6*/
7
8#ifndef KMODIFIERKEYINFOPROVIDERXCB_H
9#define KMODIFIERKEYINFOPROVIDERXCB_H
10
11#include "kmodifierkeyinfoprovider_p.h"
12#include <QAbstractNativeEventFilter>
13
14class KModifierKeyInfoProviderXcb : public KModifierKeyInfoProvider, public QAbstractNativeEventFilter
15{
16 Q_OBJECT
17public:
18 KModifierKeyInfoProviderXcb();
19 ~KModifierKeyInfoProviderXcb() override;
20
21 bool setKeyLatched(Qt::Key key, bool latched) override;
22 bool setKeyLocked(Qt::Key key, bool locked) override;
23
24 bool nativeEventFilter(const QByteArray &eventType, void *message, qintptr *) override;
25
26 void xkbUpdateModifierMapping();
27 void xkbModifierStateChanged(unsigned char mods, unsigned char latched_mods, unsigned char locked_mods);
28 void xkbButtonStateChanged(unsigned short ptr_buttons);
29
30private:
31 int m_xkbEv;
32 bool m_xkbAvailable;
33
34 // maps a Qt::Key to a modifier mask
35 QHash<Qt::Key, unsigned int> m_xkbModifiers;
36 // maps a Qt::MouseButton to a button mask
38};
39
40#endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:02:23 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.