mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2025-09-03 05:37:55 -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:
|
||||
wxGetApp().showFrequencyInput();
|
||||
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:
|
||||
event.Skip();
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user