![]() |
AntiMicroX
|
Singleton facade for platform key mapping selection. More...
#include <antkeymapper.h>
Public Member Functions | |
| void | deleteInstance () |
| int | returnVirtualKey (int qkey) |
| Translate a Qt key to a platform virtual key code. | |
| int | returnQtKey (int key, int scancode=0) |
| Translate a platform virtual key to a Qt key. | |
| bool | isModifierKey (int qkey) |
| Check if a given Qt key is treated as a modifier key. | |
| QtKeyMapperBase * | getNativeKeyMapper () const |
| QtKeyMapperBase * | getKeyMapper () const |
| bool | hasNativeKeyMapper () |
Static Public Member Functions | |
| static AntKeyMapper * | getInstance (QString handler="") |
| Obtain the singleton instance. | |
Static Protected Attributes | |
| static AntKeyMapper * | _instance = nullptr |
Private Member Functions | |
| AntKeyMapper (QString handler="", QObject *parent=nullptr) | |
Private Attributes | |
| QtKeyMapperBase * | internalMapper |
| QtKeyMapperBase * | nativeKeyMapper |
Singleton facade for platform key mapping selection.
AntKeyMapper chooses and exposes an appropriate platform-specific key mapper implementation (a subclass of QtKeyMapperBase) based on the selected event generator (e.g. "xtest", "uinput" or "sendinput"). It provides convenient wrappers to translate between Qt keys and platform virtual keys and to query whether a native mapper is available.
| void AntKeyMapper::deleteInstance | ( | ) |
|
static |
Obtain the singleton instance.
| handler | Name of the backend handler to use (must be one of the supported event generators). If an instance does not yet exist it will be created using this handler. |
| QtKeyMapperBase * AntKeyMapper::getKeyMapper | ( | ) | const |
| QtKeyMapperBase * AntKeyMapper::getNativeKeyMapper | ( | ) | const |
| bool AntKeyMapper::hasNativeKeyMapper | ( | ) |
Check if a given Qt key is treated as a modifier key.
| qkey | Qt key value |
Translate a platform virtual key to a Qt key.
| key | Platform virtual key code |
| scancode | Optional scancode used by some backends |
Translate a Qt key to a platform virtual key code.
| qkey | Qt::Key_* value |
|
staticprotected |
|
private |
Active mapper used by the app
|
private |
Optional native mapper for low-level queries