2
* Copyright 2009 Aaron Seigo <aseigo@kde.org>
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU Library General Public License as
6
* published by the Free Software Foundation; either version 2 or
7
* (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details
14
* You should have received a copy of the GNU Library General Public
15
* License along with this program; if not, write to the
16
* Free Software Foundation, Inc.,
17
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20
#ifndef KEYSTATEENGINE_H
21
#define KEYSTATEENGINE_H
23
#include <Plasma/DataEngine>
25
#include <kmodifierkeyinfo.h>
28
* This engine provides the current state of the keyboard modifiers
29
* and mouse buttons, primarily useful for accessibility feature support.
31
class KeyStatesEngine : public Plasma::DataEngine
36
KeyStatesEngine(QObject *parent, const QVariantList &args);
40
Plasma::Service *serviceForSource(const QString &source);
43
//bool sourceRequestEvent(const QString &name);
44
//bool updateSourceEvent(const QString &source);
47
void keyPressed(Qt::Key key, bool state);
48
void keyLatched(Qt::Key key, bool state);
49
void keyLocked(Qt::Key key, bool state);
50
void mouseButtonPressed(Qt::MouseButton button, bool state);
51
void keyAdded(Qt::Key key);
52
void keyRemoved(Qt::Key key);
55
KModifierKeyInfo m_keyInfo;
56
QMap<Qt::Key, QString> m_mods;
57
QMap<Qt::MouseButton, QString> m_buttons;
60
#endif // KEYSTATEENGINE_H