added addGlobalMapping method

Enables overrides for specific key sequences, fixes #11
This commit is contained in:
Skycoder42
2017-12-21 18:12:48 +01:00
parent 670705e4e0
commit fc259100b2
4 changed files with 32 additions and 0 deletions
+7
View File
@@ -1,6 +1,8 @@
#include "hottestwidget.h"
#include "ui_hottestwidget.h"
//#define TEST_MAPPING
HotTestWidget::HotTestWidget(QWidget *parent) :
QWidget(parent),
ui(new Ui::HotTestWidget),
@@ -18,6 +20,11 @@ HotTestWidget::HotTestWidget(QWidget *parent) :
this->thread4->start();
this->thread5->start();
#ifdef TEST_MAPPING
//shortcut mapping override
QHotkey::addGlobalMapping(QKeySequence("X"), QHotkey::NativeShortcut());// add invalid mapping to test if the overwrite works for all platforms
#endif
//1
connect(this->ui->hotkeyCheckbox_1, &QCheckBox::toggled,
this->hotkey_1, &QHotkey::setRegistered);