Skip to content

Commit

Permalink
Add keyboard shortcut for changing history length
Browse files Browse the repository at this point in the history
  • Loading branch information
glopesdev committed Jun 16, 2023
1 parent 57c132d commit b3797c1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Bonsai.Dsp.Design/Bonsai.Dsp.Design.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<PackageTags>Bonsai Rx Dsp Visualizers</PackageTags>
<UseWindowsForms>true</UseWindowsForms>
<TargetFramework>net462</TargetFramework>
<VersionPrefix>2.7.0</VersionPrefix>
<VersionPrefix>2.8.0</VersionPrefix>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Bonsai.Design.Visualizers\Bonsai.Design.Visualizers.csproj" />
Expand Down
12 changes: 12 additions & 0 deletions Bonsai.Dsp.Design/WaveformView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,18 @@ protected override bool ProcessDialogKey(Keys keyData)
SelectedPage--;
}

if (modifiers.HasFlag(Keys.Control) && keyCode == Keys.Oemplus)
{
var factor = modifiers.HasFlag(Keys.Shift) ? 10 : 1;
HistoryLength += factor;
}

if (modifiers.HasFlag(Keys.Control) && keyCode == Keys.OemMinus)
{
var factor = modifiers.HasFlag(Keys.Shift) ? 10 : 1;
HistoryLength = Math.Max(1, HistoryLength - factor);
}

return base.ProcessDialogKey(keyData);
}

Expand Down
2 changes: 1 addition & 1 deletion Bonsai.Dsp/Bonsai.Dsp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<PackageTags>Bonsai Rx Dsp Signal Processing</PackageTags>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFramework>net462</TargetFramework>
<VersionPrefix>2.7.0</VersionPrefix>
<VersionPrefix>2.8.0</VersionPrefix>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="OpenCV.Net" Version="3.4.1" />
Expand Down

0 comments on commit b3797c1

Please sign in to comment.