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
commit
4803687cc4
|
@ -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)
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -68,6 +68,8 @@ class FreeDVReporterDialog : public wxDialog
|
|||
|
||||
void setBandFilter(FilterFrequency freq);
|
||||
|
||||
bool isTextMessageFieldInFocus();
|
||||
|
||||
protected:
|
||||
|
||||
// Handlers for events.
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue