KDEUI
#include <kmodifierkeyinfo.h>
Signals | |
void | buttonPressed (Qt::MouseButton button, bool pressed) |
void | keyAdded (Qt::Key key) |
void | keyLatched (Qt::Key key, bool latched) |
void | keyLocked (Qt::Key key, bool locked) |
void | keyPressed (Qt::Key key, bool pressed) |
void | keyRemoved (Qt::Key key) |
Public Member Functions | |
KModifierKeyInfo (QObject *parent=0) | |
virtual | ~KModifierKeyInfo () |
bool | isButtonPressed (Qt::MouseButton button) const |
bool | isKeyLatched (Qt::Key key) const |
bool | isKeyLocked (Qt::Key key) const |
bool | isKeyPressed (Qt::Key key) const |
const QList< Qt::Key > | knownKeys () const |
bool | knowsKey (Qt::Key key) const |
bool | setKeyLatched (Qt::Key key, bool latched) |
bool | setKeyLocked (Qt::Key key, bool locked) |
Public Member Functions inherited from QObject | |
QObject (QObject *parent) | |
QObject (QObject *parent, const char *name) | |
virtual | ~QObject () |
bool | blockSignals (bool block) |
QObject * | child (const char *objName, const char *inheritsClass, bool recursiveSearch) const |
const QObjectList & | children () const |
const char * | className () const |
bool | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const QObject *receiver, const char *method) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) |
void | dumpObjectInfo () |
void | dumpObjectTree () |
QList< QByteArray > | dynamicPropertyNames () const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name) const |
QList< T > | findChildren (const QRegExp ®Exp) const |
QList< T > | findChildren (const QString &name) const |
bool | inherits (const char *className) const |
void | insertChild (QObject *object) |
void | installEventFilter (QObject *filterObj) |
bool | isA (const char *className) const |
bool | isWidgetType () const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const |
void | moveToThread (QThread *targetThread) |
const char * | name () const |
const char * | name (const char *defaultName) const |
QString | objectName () const |
QObject * | parent () const |
QVariant | property (const char *name) const |
void | removeChild (QObject *object) |
void | removeEventFilter (QObject *obj) |
void | setName (const char *name) |
void | setObjectName (const QString &name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | signalsBlocked () const |
int | startTimer (int interval) |
QThread * | thread () const |
Additional Inherited Members | |
Static Public Member Functions inherited from QObject | |
bool | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
bool | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
Protected Member Functions inherited from QObject | |
bool | checkConnectArgs (const char *signal, const QObject *object, const char *method) |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const char *signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const char *signal) |
int | receivers (const char *signal) const |
QObject * | sender () const |
int | senderSignalIndex () const |
virtual void | timerEvent (QTimerEvent *event) |
Static Protected Member Functions inherited from QObject | |
QByteArray | normalizeSignalSlot (const char *signalSlot) |
Properties inherited from QObject | |
objectName | |
Detailed Description
Get information about the state of the keyboard's modifier keys.
This class provides cross-platform information about the state of the keyboard's modifier keys and the mouse buttons and allows to change the state as well.
It recognizes two states a key can be in:
- locked: eg. caps-locked (aka toggled)
- latched: the key is temporarily locked but will be unlocked upon the next keypress.
An application can either query the states synchronously (
- See also
- isKeyLatched,
- isKeyLocked) or connect to KModifierKeyInfo's signals to be notified about changes (
- keyLatched,
- keyLocked).
Definition at line 46 of file kmodifierkeyinfo.h.
Constructor & Destructor Documentation
KModifierKeyInfo::KModifierKeyInfo | ( | QObject * | parent = 0 | ) |
Default constructor.
Definition at line 24 of file kmodifierkeyinfo.cpp.
|
virtual |
Destructor.
Definition at line 36 of file kmodifierkeyinfo.cpp.
Member Function Documentation
|
signal |
This signal is emitted whenever the pressed state of a mouse button changes (mouse button press or release).
- Parameters
-
button The mouse button that changed state pressed true if the mouse button is now pressed, false if is released.
bool KModifierKeyInfo::isButtonPressed | ( | Qt::MouseButton | button | ) | const |
Synchronously check if a mouse button is pressed.
- Parameters
-
button The mouse button to check
- Returns
- true if the mouse button is pressed, false if the mouse button is not pressed or its state is unknown.
Definition at line 76 of file kmodifierkeyinfo.cpp.
bool KModifierKeyInfo::isKeyLatched | ( | Qt::Key | key | ) | const |
Synchronously check if a key is latched.
- Parameters
-
key The key to check
- Returns
- true if the key is latched, false if the key is not latched or unknown.
- See also
- isKeyPressed,
- isKeyLocked,
- keyLatched
Definition at line 56 of file kmodifierkeyinfo.cpp.
bool KModifierKeyInfo::isKeyLocked | ( | Qt::Key | key | ) | const |
Synchronously check if a key is locked.
- Parameters
-
key The key to check
- Returns
- true if the key is locked, false if the key is not locked or unknown.
- See also
- isKeyPressed,
- isKeyLatched,
- keyLocked
Definition at line 66 of file kmodifierkeyinfo.cpp.
bool KModifierKeyInfo::isKeyPressed | ( | Qt::Key | key | ) | const |
Synchronously check if a key is pressed.
- Parameters
-
key The key to check
- Returns
- true if the key is pressed, false if the key is not pressed or unknown.
- See also
- isKeyLatched,
- isKeyLocked,
- keyPressed
Definition at line 51 of file kmodifierkeyinfo.cpp.
|
signal |
This signal is emitted whenever a new modifier is found due to the keyboard mapping changing.
- Parameters
-
key The key that was discovered
|
signal |
This signal is emitted whenever the latched state of a key changes.
- Parameters
-
key The key that changed state latched true if the key is now latched, false if it isn't
|
signal |
This signal is emitted whenever the locked state of a key changes.
- Parameters
-
key The key that changed state locked true if the key is now locked, false if it isn't
|
signal |
This signal is emitted whenever the pressed state of a key changes (key press or key release).
- Parameters
-
key The key that changed state pressed true if the key is now pressed, false if is released.
|
signal |
This signal is emitted whenever a previously known modifier no longer exists due to the keyboard mapping changing.
- Parameters
-
key The key that vanished
const QList< Qt::Key > KModifierKeyInfo::knownKeys | ( | ) | const |
Get a list of known keys.
- Returns
- A list of known keys of which states will be reported.
Definition at line 46 of file kmodifierkeyinfo.cpp.
bool KModifierKeyInfo::knowsKey | ( | Qt::Key | key | ) | const |
Check if a key is known by the underlying window system and can be queried.
- Parameters
-
key The key to check
- Returns
- true if the key is available, false if it is unknown
Definition at line 41 of file kmodifierkeyinfo.cpp.
Set the latched state of a key.
- Parameters
-
key The key to latch latched true to latch the key, false to unlatch it.
- Returns
- false if the key is unknown. true doesn't guarantee you the operation worked.
Definition at line 61 of file kmodifierkeyinfo.cpp.
Set the locked state of a key.
- Parameters
-
key The key to lock latched true to lock the key, false to unlock it.
- Returns
- false if the key is unknown. true doesn't guarantee you the operation worked.
Definition at line 71 of file kmodifierkeyinfo.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:02 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.