Merge pull request #666 from drowe67/ms-spacebar-ptt-reporter

Enable use of space bar for PTT when in the FreeDV Reporter window.
pull/665/head^2
Mooneer Salem 2024-01-24 09:24:04 -08:00 committed by GitHub
commit 4803687cc4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 14 additions and 1 deletions

View File

@ -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)

View File

@ -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;

View File

@ -68,6 +68,8 @@ class FreeDVReporterDialog : public wxDialog
void setBandFilter(FilterFrequency freq);
bool isTextMessageFieldInFocus();
protected:
// Handlers for events.

View File

@ -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) {