mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2025-09-05 14:47:52 -04:00
Press 'c' on waterfall/demod to center to frequency
This commit is contained in:
parent
d2d6f92502
commit
beab55a49e
@ -441,6 +441,21 @@ void WaterfallCanvas::OnKeyDown(wxKeyEvent& event) {
|
|||||||
case WXK_SPACE:
|
case WXK_SPACE:
|
||||||
wxGetApp().showFrequencyInput();
|
wxGetApp().showFrequencyInput();
|
||||||
break;
|
break;
|
||||||
|
case 'C':
|
||||||
|
if (wxGetApp().getDemodMgr().getActiveDemodulator()) {
|
||||||
|
wxGetApp().setFrequency(wxGetApp().getDemodMgr().getActiveDemodulator()->getFrequency());
|
||||||
|
} else if (mouseTracker.mouseInView()) {
|
||||||
|
long long freq = getFrequencyAt(mouseTracker.getMouseX());
|
||||||
|
|
||||||
|
int snap = wxGetApp().getFrequencySnap();
|
||||||
|
|
||||||
|
if (snap > 1) {
|
||||||
|
freq = roundf((float)freq/(float)snap)*snap;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxGetApp().setFrequency(freq);
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
event.Skip();
|
event.Skip();
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user