From 8f0ba10735a311eb14fc57a32bb58ddf19f0d82a Mon Sep 17 00:00:00 2001 From: "Charles J. Cliffe" Date: Fri, 12 Feb 2016 20:38:05 -0500 Subject: [PATCH] Add global key [ and ] for nudging modem by snap setting --- src/AppFrame.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/AppFrame.cpp b/src/AppFrame.cpp index d2744e0..3d29593 100644 --- a/src/AppFrame.cpp +++ b/src/AppFrame.cpp @@ -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; }