summaryrefslogtreecommitdiff
path: root/grapher/Models/Mouse
diff options
context:
space:
mode:
authorJacobPalecki <[email protected]>2020-09-08 16:00:05 -0700
committerGitHub <[email protected]>2020-09-08 16:00:05 -0700
commite5461fa84e65d78823d0022339fa2d8864f7e63c (patch)
treeb486ef524c93bfeb29a86403114b6805bf9decf1 /grapher/Models/Mouse
parentMerge pull request #19 from JacobPalecki/gainOffset (diff)
parentSave show last mouse value (diff)
downloadrawaccel-e5461fa84e65d78823d0022339fa2d8864f7e63c.tar.xz
rawaccel-e5461fa84e65d78823d0022339fa2d8864f7e63c.zip
Merge pull request #20 from JacobPalecki/GUI
GUI: Add By Component & Anisotropy; Remove Logarithm and Sigmoid; Delete Console; Some Refactoring
Diffstat (limited to 'grapher/Models/Mouse')
-rw-r--r--grapher/Models/Mouse/MouseWatcher.cs20
-rw-r--r--grapher/Models/Mouse/PointData.cs16
2 files changed, 27 insertions, 9 deletions
diff --git a/grapher/Models/Mouse/MouseWatcher.cs b/grapher/Models/Mouse/MouseWatcher.cs
index fea4e2d..405110e 100644
--- a/grapher/Models/Mouse/MouseWatcher.cs
+++ b/grapher/Models/Mouse/MouseWatcher.cs
@@ -1,16 +1,12 @@
using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Linq;
using System.Runtime.InteropServices;
-using System.Text;
-using System.Threading.Tasks;
using System.Windows.Forms;
namespace grapher.Models.Mouse
{
public class MouseWatcher
{
+ #region External
/// <summary>
/// Enumeration containing HID usage page flags.
/// </summary>
@@ -677,6 +673,10 @@ namespace grapher.Models.Mouse
[DllImport("user32.dll")]
public static extern int GetRawInputData(IntPtr hRawInput, RawInputCommand uiCommand, out RawInput pData, ref int pcbSize, int cbSizeHeader);
+ #endregion External
+
+ #region Constructors
+
public MouseWatcher(Form containingForm, Label display, AccelCharts accelCharts)
{
ContainingForm = containingForm;
@@ -695,6 +695,10 @@ namespace grapher.Models.Mouse
PollTime = 1;
}
+ #endregion Constructors
+
+ #region Properties
+
private Form ContainingForm { get; }
private Label Display { get; }
@@ -703,6 +707,10 @@ namespace grapher.Models.Mouse
private double PollTime { get; }
+ #endregion Properties
+
+ #region Methods
+
public void OnMouseMove(int x, int y, double timeInMs)
{
Display.Text = $"Last (x, y): ({x}, {y})";
@@ -723,5 +731,7 @@ namespace grapher.Models.Mouse
}
}
+
+ #endregion Methods
}
}
diff --git a/grapher/Models/Mouse/PointData.cs b/grapher/Models/Mouse/PointData.cs
index 12a6e73..374c52e 100644
--- a/grapher/Models/Mouse/PointData.cs
+++ b/grapher/Models/Mouse/PointData.cs
@@ -1,13 +1,11 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
namespace grapher.Models.Mouse
{
public class PointData
{
+ #region Constructors
+
public PointData()
{
Lock = new Object();
@@ -15,6 +13,10 @@ namespace grapher.Models.Mouse
Y = new double[] { 0 };
}
+ #endregion Constructors
+
+ #region Properties
+
public Object Lock { get; }
private double[] X { get; set; }
@@ -29,6 +31,10 @@ namespace grapher.Models.Mouse
}
}
+ #endregion Properties
+
+ #region Methods
+
public void Get(out double[] x, out double[] y)
{
lock(Lock)
@@ -37,5 +43,7 @@ namespace grapher.Models.Mouse
y = Y;
}
}
+
+ #endregion Methods
}
}