From 13d1f23e1d509747c5b96b1237e652def203f6e0 Mon Sep 17 00:00:00 2001 From: Mooneer Salem Date: Sun, 21 Jan 2024 14:37:47 -0800 Subject: [PATCH 1/2] Enable use of space bar for PTT when in the FreeDV Reporter window. --- src/gui/dialogs/freedv_reporter.cpp | 5 +++++ src/gui/dialogs/freedv_reporter.h | 2 ++ src/ongui.cpp | 7 ++++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/gui/dialogs/freedv_reporter.cpp b/src/gui/dialogs/freedv_reporter.cpp index 87b101716..b89720cdb 100644 --- a/src/gui/dialogs/freedv_reporter.cpp +++ b/src/gui/dialogs/freedv_reporter.cpp @@ -392,6 +392,11 @@ FreeDVReporterDialog::~FreeDVReporterDialog() m_bandFilter->Disconnect(wxEVT_TEXT, wxCommandEventHandler(FreeDVReporterDialog::OnBandFilterChange), NULL, this); } +bool FreeDVReporterDialog::isTextMessageFieldInFocus() +{ + return m_statusMessage->HasFocus(); +} + void FreeDVReporterDialog::refreshLayout() { int colOffset = 0; diff --git a/src/gui/dialogs/freedv_reporter.h b/src/gui/dialogs/freedv_reporter.h index b8821a913..2571f211a 100644 --- a/src/gui/dialogs/freedv_reporter.h +++ b/src/gui/dialogs/freedv_reporter.h @@ -68,6 +68,8 @@ class FreeDVReporterDialog : public wxDialog void setBandFilter(FilterFrequency freq); + bool isTextMessageFieldInFocus(); + protected: // Handlers for events. diff --git a/src/ongui.cpp b/src/ongui.cpp index 025970fba..eaa108011 100644 --- a/src/ongui.cpp +++ b/src/ongui.cpp @@ -787,7 +787,12 @@ int MainApp::FilterEvent(wxEvent& event) (((wxKeyEvent&)event).GetKeyCode() == WXK_SPACE)) { // only use space to toggle PTT if we are running and no modal dialogs (like options) up - if (frame->m_RxRunning && frame->IsActive() && wxGetApp().appConfiguration.enableSpaceBarForPTT && !frame->isReceiveOnly()) { + bool mainWindowActive = frame->IsActive(); + bool reporterActiveButNotUpdatingTextMessage = + frame->m_reporterDialog != nullptr && frame->m_reporterDialog->IsActive() && + !frame->m_reporterDialog->isTextMessageFieldInFocus(); + if (frame->m_RxRunning && (mainWindowActive || reporterActiveButNotUpdatingTextMessage) && + wxGetApp().appConfiguration.enableSpaceBarForPTT && !frame->isReceiveOnly()) { // space bar controls rx/rx if keyer not running if (frame->vk_state == VK_IDLE) { From 5b79f45010cd9b311e23ca4757c971d262002d0c Mon Sep 17 00:00:00 2001 From: Mooneer Salem Date: Sun, 21 Jan 2024 14:39:14 -0800 Subject: [PATCH 2/2] Add PR #666 to changelog. --- USER_MANUAL.md | 1 + 1 file changed, 1 insertion(+) diff --git a/USER_MANUAL.md b/USER_MANUAL.md index 5f1210b36..e7af82d18 100644 --- a/USER_MANUAL.md +++ b/USER_MANUAL.md @@ -895,6 +895,7 @@ LDPC | Low Density Parity Check Codes - a family of powerful FEC codes * Prevent unnecessary recreation of resamplers in analog mode. (PR #661) 2. Enhancements: * Add Frequency column to RX drop-down. (PR #663) + * Enable use of space bar for PTT when in the FreeDV Reporter window. (PR #666) 3. Code cleanup: * Move FreeDV Reporter dialog code to dialogs section of codebase. (PR #664)