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:
+15
-5
@@ -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)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user