Add global key [ and ] for nudging modem by snap setting

This commit is contained in:
Charles J. Cliffe 2016-02-12 20:38:05 -05:00
parent 843363d961
commit 8f0ba10735

View File

@ -1611,6 +1611,7 @@ int AppFrame::OnGlobalKeyDown(wxKeyEvent &event) {
}
DemodulatorInstance *demod = nullptr, *lastDemod = wxGetApp().getDemodMgr().getLastActiveDemodulator();
int snap = wxGetApp().getFrequencySnap();
switch (event.GetKeyCode()) {
case WXK_UP:
@ -1621,8 +1622,20 @@ int AppFrame::OnGlobalKeyDown(wxKeyEvent &event) {
case WXK_NUMPAD_LEFT:
case WXK_RIGHT:
case WXK_NUMPAD_RIGHT:
waterfallCanvas->OnKeyDown(event);
waterfallCanvas->OnKeyDown(event); // TODO: Move the stuff from there to here
return 1;
case ']':
if (lastDemod) {
lastDemod->setFrequency(lastDemod->getFrequency()+snap);
}
return 1;
break;
case '[':
if (lastDemod) {
lastDemod->setFrequency(lastDemod->getFrequency()-snap);
}
return 1;
break;
case 'A':
case 'F':
case 'L':
@ -1716,6 +1729,9 @@ int AppFrame::OnGlobalKeyUp(wxKeyEvent &event) {
wxGetApp().setSoloMode(!wxGetApp().getSoloMode());
return 1;
break;
case ']':
case '[':
return 1;
default:
break;
}