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

KDEUI

  • sources
  • kde-4.12
  • kdelibs
  • 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 
24 KModifierKeyInfo::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 
36 KModifierKeyInfo::~KModifierKeyInfo()
37 {
38  delete p;
39 }
40 
41 bool KModifierKeyInfo::knowsKey(Qt::Key key) const
42 {
43  return p->knowsKey(key);
44 }
45 
46 const QList<Qt::Key> KModifierKeyInfo::knownKeys() const
47 {
48  return p->knownKeys();
49 }
50 
51 bool KModifierKeyInfo::isKeyPressed(Qt::Key key) const
52 {
53  return p->isKeyPressed(key);
54 }
55 
56 bool KModifierKeyInfo::isKeyLatched(Qt::Key key) const
57 {
58  return p->isKeyLatched(key);
59 }
60 
61 bool KModifierKeyInfo::setKeyLatched(Qt::Key key, bool latched)
62 {
63  return p->setKeyLatched(key, latched);
64 }
65 
66 bool KModifierKeyInfo::isKeyLocked(Qt::Key key) const
67 {
68  return p->isKeyLocked(key);
69 }
70 
71 bool KModifierKeyInfo::setKeyLocked(Qt::Key key, bool locked)
72 {
73  return p->setKeyLocked(key, locked);
74 }
75 
76 bool KModifierKeyInfo::isButtonPressed(Qt::MouseButton button) const
77 {
78  return p->isButtonPressed(button);
79 }
80 
81 #include "kmodifierkeyinfo.moc"
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::keyLocked
void keyLocked(Qt::Key key, bool locked)
This signal is emitted whenever the locked state of a key changes.
QObject
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::isKeyLatched
bool isKeyLatched(Qt::Key key) const
Synchronously check if a key is latched.
Definition: kmodifierkeyinfo.cpp:56
KModifierKeyInfo::KModifierKeyInfo
KModifierKeyInfo(QObject *parent=0)
Default constructor.
Definition: kmodifierkeyinfo.cpp:24
KModifierKeyInfo::knownKeys
const QList< Qt::Key > knownKeys() const
Get a list of known keys.
Definition: kmodifierkeyinfo.cpp:46
KModifierKeyInfo::setKeyLocked
bool setKeyLocked(Qt::Key key, bool locked)
Set the locked state of a key.
Definition: kmodifierkeyinfo.cpp:71
KModifierKeyInfo::setKeyLatched
bool setKeyLatched(Qt::Key key, bool latched)
Set the latched state of a key.
Definition: kmodifierkeyinfo.cpp:61
KModifierKeyInfo::isKeyPressed
bool isKeyPressed(Qt::Key key) const
Synchronously check if a key is pressed.
Definition: kmodifierkeyinfo.cpp:51
KModifierKeyInfo::keyLatched
void keyLatched(Qt::Key key, bool latched)
This signal is emitted whenever the latched state of a key changes.
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...
KModifierKeyInfo::~KModifierKeyInfo
virtual ~KModifierKeyInfo()
Destructor.
Definition: kmodifierkeyinfo.cpp:36
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::isButtonPressed
bool isButtonPressed(Qt::MouseButton button) const
Synchronously check if a mouse button is pressed.
Definition: kmodifierkeyinfo.cpp:76
KModifierKeyInfo::keyAdded
void keyAdded(Qt::Key key)
This signal is emitted whenever a new modifier is found due to the keyboard mapping changing...
kmodifierkeyinfo.h
QList
KModifierKeyInfo::isKeyLocked
bool isKeyLocked(Qt::Key key) const
Synchronously check if a key is locked.
Definition: kmodifierkeyinfo.cpp:66
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:49:15 by doxygen 1.8.7 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 API Reference

Skip menu "kdelibs 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
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



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