summaryrefslogtreecommitdiff
path: root/grapher/Models/Mouse
diff options
context:
space:
mode:
authorJacob Palecki <[email protected]>2020-09-22 13:08:31 -0700
committerJacob Palecki <[email protected]>2020-09-22 13:08:31 -0700
commit45285413a94c9c081098c672e69e9811ac5262b7 (patch)
tree4c89d57a30226e2d1c007547fa5cf787118f3158 /grapher/Models/Mouse
parentFix bug & rename x axis to input speed (diff)
downloadrawaccel-45285413a94c9c081098c672e69e9811ac5262b7.tar.xz
rawaccel-45285413a94c9c081098c672e69e9811ac5262b7.zip
Rename experiment two to motivity
Diffstat (limited to 'grapher/Models/Mouse')
-rw-r--r--grapher/Models/Mouse/MouseData.cs49
-rw-r--r--grapher/Models/Mouse/MouseWatcher.cs3
2 files changed, 52 insertions, 0 deletions
diff --git a/grapher/Models/Mouse/MouseData.cs b/grapher/Models/Mouse/MouseData.cs
new file mode 100644
index 0000000..e59a969
--- /dev/null
+++ b/grapher/Models/Mouse/MouseData.cs
@@ -0,0 +1,49 @@
+using System;
+
+namespace grapher.Models.Mouse
+{
+ public class MouseData
+ {
+ #region Constructors
+
+ public MouseData()
+ {
+ Lock = new Object();
+ X = 0;
+ Y = 0;
+ }
+
+ #endregion Constructors
+
+ #region Properties
+
+ public Object Lock { get; }
+
+ private int X { get; set; }
+ private int Y { get; set; }
+
+ public void Set(int x, int y)
+ {
+ lock (Lock)
+ {
+ X = x;
+ Y = y;
+ }
+ }
+
+ #endregion Properties
+
+ #region Methods
+
+ public void Get(out int x, out int y)
+ {
+ lock (Lock)
+ {
+ x = X;
+ y = Y;
+ }
+ }
+
+ #endregion Methods
+ }
+}
diff --git a/grapher/Models/Mouse/MouseWatcher.cs b/grapher/Models/Mouse/MouseWatcher.cs
index 405110e..86b1c2e 100644
--- a/grapher/Models/Mouse/MouseWatcher.cs
+++ b/grapher/Models/Mouse/MouseWatcher.cs
@@ -682,6 +682,7 @@ namespace grapher.Models.Mouse
ContainingForm = containingForm;
Display = display;
AccelCharts = accelCharts;
+ MouseData = new MouseData();
RAWINPUTDEVICE device = new RAWINPUTDEVICE();
device.WindowHandle = ContainingForm.Handle;
@@ -705,6 +706,8 @@ namespace grapher.Models.Mouse
private AccelCharts AccelCharts { get; }
+ private MouseData MouseData { get; }
+
private double PollTime { get; }
#endregion Properties