summaryrefslogtreecommitdiff
path: root/grapher/Models/AccelGUI.cs
diff options
context:
space:
mode:
authorJacob Palecki <[email protected]>2020-09-25 22:21:26 -0700
committerJacob Palecki <[email protected]>2020-09-25 22:21:26 -0700
commit70360dd3c19909737d29c0b2b9fb1a7ba3f12bba (patch)
tree345c3329330271145e67733a1a9ca79ebf00448c /grapher/Models/AccelGUI.cs
parentFix 0 point for separate x y sens (diff)
downloadrawaccel-70360dd3c19909737d29c0b2b9fb1a7ba3f12bba.tar.xz
rawaccel-70360dd3c19909737d29c0b2b9fb1a7ba3f12bba.zip
Last mouse move perfetly responsive at 100 FPS
Diffstat (limited to 'grapher/Models/AccelGUI.cs')
-rw-r--r--grapher/Models/AccelGUI.cs19
1 files changed, 19 insertions, 0 deletions
diff --git a/grapher/Models/AccelGUI.cs b/grapher/Models/AccelGUI.cs
index dd394c5..131df9c 100644
--- a/grapher/Models/AccelGUI.cs
+++ b/grapher/Models/AccelGUI.cs
@@ -38,6 +38,7 @@ namespace grapher
WriteButton.Click += new System.EventHandler(OnWriteButtonClick);
ButtonTimer = SetupButtonTimer();
+ ChartRefresh = SetupChartTimer();
SetupWriteButton();
}
@@ -63,6 +64,8 @@ namespace grapher
public ToolStripMenuItem ScaleMenuItem { get; }
+ private Timer ChartRefresh { get; }
+
#endregion Properties
#region Methods
@@ -110,6 +113,15 @@ namespace grapher
ApplyOptions.SetActiveValues(settings);
}
+ private Timer SetupChartTimer()
+ {
+ Timer chartTimer = new Timer();
+ chartTimer.Enabled = true;
+ chartTimer.Interval = 10;
+ chartTimer.Tick += new System.EventHandler(OnChartTimerTick);
+ return chartTimer;
+ }
+
private Timer SetupButtonTimer()
{
Timer buttonTimer = new Timer();
@@ -159,6 +171,13 @@ namespace grapher
ButtonTimer.Start();
}
+ private void OnChartTimerTick(object sender, EventArgs e)
+ {
+ AccelCharts.DrawLastMovement();
+ MouseWatcher.UpdateLastMove();
+ AccelCharts.Redraw();
+ }
+
#endregion Methods
}