1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-18 21:58:37 -04:00

CW keyer keyboard input: GUI mods (1)

This commit is contained in:
f4exb
2019-07-29 18:54:50 +02:00
parent aaa2647cb1
commit 57efa91a5b
8 changed files with 482 additions and 11 deletions
+15 -5
View File
@@ -1273,20 +1273,30 @@ void MainWindow::on_commandsSave_clicked()
m_settings.save();
}
void MainWindow::commandKeysConnect(QObject *object, const char *slot)
{
setFocus();
connect(m_commandKeyReceiver, SIGNAL(capturedKey(Qt::Key, Qt::KeyboardModifiers, bool)),
object, slot);
}
void MainWindow::commandKeysDisconnect(QObject *object, const char *slot)
{
disconnect(m_commandKeyReceiver, SIGNAL(capturedKey(Qt::Key, Qt::KeyboardModifiers, bool)),
object, slot);
}
void MainWindow::on_commandKeyboardConnect_toggled(bool checked)
{
qDebug("on_commandKeyboardConnect_toggled: %s", checked ? "true" : "false");
if (checked)
{
setFocus();
connect(m_commandKeyReceiver, SIGNAL(capturedKey(Qt::Key, Qt::KeyboardModifiers, bool)),
this, SLOT(commandKeyPressed(Qt::Key, Qt::KeyboardModifiers, bool)));
commandKeysConnect(this, SLOT(commandKeyPressed(Qt::Key, Qt::KeyboardModifiers, bool)));
}
else
{
disconnect(m_commandKeyReceiver, SIGNAL(capturedKey(Qt::Key, Qt::KeyboardModifiers, bool)),
this, SLOT(commandKeyPressed(Qt::Key, Qt::KeyboardModifiers, bool)));
commandKeysDisconnect(this, SLOT(commandKeyPressed(Qt::Key, Qt::KeyboardModifiers, bool)));
}
}