Commit 9267a921 authored by haru's avatar haru
Browse files

added pressable f-keys

parent 64d63fa0
......@@ -74,7 +74,11 @@ void MainWindow::updateChannel(Channel *channel)
void MainWindow::processBtnClick(qint8 btn)
{
qDebug() << "Pressed Btn" << btn;
UserctrlButton *btnData = this->btnData->value(btn);
if(btnData == nullptr) return;
switch (btnData->type) {
case X32ConfigBtn::BtnMute:
emit mute(btnData->data.right(2).toInt());
......@@ -87,6 +91,19 @@ void MainWindow::processBtnClick(qint8 btn)
}
}
void MainWindow::keyPressEvent(QKeyEvent *event)
{
qDebug() << "Pressed Key:" << event->key();
int key = event->key();
if(key >= Qt::Key_F1 && key <= Qt::Key_F9) {
int fKey = key - Qt::Key_F1 + 1;
qDebug() << "Pressed: F" << fKey;
processBtnClick(fKey + 4 + ((fKey > 3) ? 1 : 0) );
}
}
// Layout:
// 5 6 7 | 8
// 9 10 11 | 12
......
......@@ -11,6 +11,7 @@
#include <QListWidget>
#include <QTreeWidgetItem>
#include <QListWidgetItem>
#include <QKeyEvent>
#include <x32Types/x32status.h>
#include <x32Types/channel.h>
......@@ -34,6 +35,8 @@ public:
~MainWindow();
void processBtnClick(qint8 btn);
void keyPressEvent(QKeyEvent* event) override;
private:
Ui::MainWindow *ui;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment