• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KDEUI

  • kdeui
  • util
kmodifierkeyinfo.cpp
Go to the documentation of this file.
1/*
2 Copyright 2009 Michael Leupold <lemma@confuego.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) version 3, or any
8 later version accepted by the membership of KDE e.V. (or its
9 successor approved by the membership of KDE e.V.), which shall
10 act as a proxy defined in Section 6 of version 3 of the license.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library. If not, see <http://www.gnu.org/licenses/>.
19*/
20
21#include "kmodifierkeyinfo.h"
22#include "kmodifierkeyinfoprovider_p.h"
23
24KModifierKeyInfo::KModifierKeyInfo(QObject *parent)
25 : QObject(parent), p(new KModifierKeyInfoProvider)
26{
27 connect(p, SIGNAL(keyPressed(Qt::Key,bool)), this, SIGNAL(keyPressed(Qt::Key,bool)));
28 connect(p, SIGNAL(keyLatched(Qt::Key,bool)), this, SIGNAL(keyLatched(Qt::Key,bool)));
29 connect(p, SIGNAL(keyLocked(Qt::Key,bool)), this, SIGNAL(keyLocked(Qt::Key,bool)));
30 connect(p, SIGNAL(buttonPressed(Qt::MouseButton,bool)),
31 this, SIGNAL(buttonPressed(Qt::MouseButton,bool)));
32 connect(p, SIGNAL(keyAdded(Qt::Key)), this, SIGNAL(keyAdded(Qt::Key)));
33 connect(p, SIGNAL(keyRemoved(Qt::Key)), this, SIGNAL(keyRemoved(Qt::Key)));
34}
35
36KModifierKeyInfo::~KModifierKeyInfo()
37{
38 delete p;
39}
40
41bool KModifierKeyInfo::knowsKey(Qt::Key key) const
42{
43 return p->knowsKey(key);
44}
45
46const QList<Qt::Key> KModifierKeyInfo::knownKeys() const
47{
48 return p->knownKeys();
49}
50
51bool KModifierKeyInfo::isKeyPressed(Qt::Key key) const
52{
53 return p->isKeyPressed(key);
54}
55
56bool KModifierKeyInfo::isKeyLatched(Qt::Key key) const
57{
58 return p->isKeyLatched(key);
59}
60
61bool KModifierKeyInfo::setKeyLatched(Qt::Key key, bool latched)
62{
63 return p->setKeyLatched(key, latched);
64}
65
66bool KModifierKeyInfo::isKeyLocked(Qt::Key key) const
67{
68 return p->isKeyLocked(key);
69}
70
71bool KModifierKeyInfo::setKeyLocked(Qt::Key key, bool locked)
72{
73 return p->setKeyLocked(key, locked);
74}
75
76bool KModifierKeyInfo::isButtonPressed(Qt::MouseButton button) const
77{
78 return p->isButtonPressed(button);
79}
80
81#include "kmodifierkeyinfo.moc"
KModifierKeyInfo::~KModifierKeyInfo
virtual ~KModifierKeyInfo()
Destructor.
Definition: kmodifierkeyinfo.cpp:36
KModifierKeyInfo::KModifierKeyInfo
KModifierKeyInfo(QObject *parent=0)
Default constructor.
Definition: kmodifierkeyinfo.cpp:24
KModifierKeyInfo::keyPressed
void keyPressed(Qt::Key key, bool pressed)
This signal is emitted whenever the pressed state of a key changes (key press or key release).
KModifierKeyInfo::keyAdded
void keyAdded(Qt::Key key)
This signal is emitted whenever a new modifier is found due to the keyboard mapping changing.
KModifierKeyInfo::knownKeys
const QList< Qt::Key > knownKeys() const
Get a list of known keys.
Definition: kmodifierkeyinfo.cpp:46
KModifierKeyInfo::keyRemoved
void keyRemoved(Qt::Key key)
This signal is emitted whenever a previously known modifier no longer exists due to the keyboard mapp...
KModifierKeyInfo::setKeyLocked
bool setKeyLocked(Qt::Key key, bool locked)
Set the locked state of a key.
Definition: kmodifierkeyinfo.cpp:71
KModifierKeyInfo::keyLocked
void keyLocked(Qt::Key key, bool locked)
This signal is emitted whenever the locked state of a key changes.
KModifierKeyInfo::knowsKey
bool knowsKey(Qt::Key key) const
Check if a key is known by the underlying window system and can be queried.
Definition: kmodifierkeyinfo.cpp:41
KModifierKeyInfo::setKeyLatched
bool setKeyLatched(Qt::Key key, bool latched)
Set the latched state of a key.
Definition: kmodifierkeyinfo.cpp:61
KModifierKeyInfo::keyLatched
void keyLatched(Qt::Key key, bool latched)
This signal is emitted whenever the latched state of a key changes.
KModifierKeyInfo::isButtonPressed
bool isButtonPressed(Qt::MouseButton button) const
Synchronously check if a mouse button is pressed.
Definition: kmodifierkeyinfo.cpp:76
KModifierKeyInfo::isKeyLatched
bool isKeyLatched(Qt::Key key) const
Synchronously check if a key is latched.
Definition: kmodifierkeyinfo.cpp:56
KModifierKeyInfo::isKeyPressed
bool isKeyPressed(Qt::Key key) const
Synchronously check if a key is pressed.
Definition: kmodifierkeyinfo.cpp:51
KModifierKeyInfo::isKeyLocked
bool isKeyLocked(Qt::Key key) const
Synchronously check if a key is locked.
Definition: kmodifierkeyinfo.cpp:66
KModifierKeyInfo::buttonPressed
void buttonPressed(Qt::MouseButton button, bool pressed)
This signal is emitted whenever the pressed state of a mouse button changes (mouse button press or re...
QList
QObject
kmodifierkeyinfo.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal