added native shortcut support (win)

This commit is contained in:
Skycoder42
2016-12-04 16:49:53 +01:00
parent 5cc4b7bf2d
commit 686abe219a
5 changed files with 347 additions and 41 deletions
+21
View File
@@ -11,6 +11,7 @@ HotTestWidget::HotTestWidget(QWidget *parent) :
hotkey_5(new QHotkey(NULL)),
thread4(new QThread(this)),
thread5(new QThread(this)),
nativeHotkey(new QHotkey(this)),
testHotkeys()
{
ui->setupUi(this);
@@ -91,6 +92,10 @@ HotTestWidget::HotTestWidget(QWidget *parent) :
this->testHotkeys += new QHotkey(Qt::Key_K, Qt::ShiftModifier | Qt::AltModifier, false, this);
connect(this->testHotkeys.last(), &QHotkey::activated,
this->ui->hotkeyShiftAltKCheckBox_2, &QCheckBox::toggle);
//native
connect(this->nativeHotkey, &QHotkey::activated,
this, &HotTestWidget::increase_native);
}
HotTestWidget::~HotTestWidget()
@@ -217,3 +222,19 @@ void HotTestWidget::on_threadEnableCheckBox_clicked()
this->ui->tabWidget->setCurrentIndex(0);
}
void HotTestWidget::on_registeredCheckBox_toggled(bool checked)
{
if(checked) {
this->nativeHotkey->setNativeShortcut({
(quint32)this->ui->nativeKeySpinBox->value(),
(quint32)this->ui->nativeModifiersSpinBox->value()
}, true);
} else
this->nativeHotkey->setRegistered(false);
}
void HotTestWidget::increase_native()
{
this->ui->nativeCount->display(this->ui->nativeCount->intValue() + 1);
}