From 6f1098372b2016db9744ad13dffbb55b77102671 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Pazdiora?= Date: Tue, 5 Jan 2021 03:50:45 +0100 Subject: add "Device Hardware ID" setting, to affect only specific device --- grapher/Models/AccelGUI.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'grapher/Models/AccelGUI.cs') diff --git a/grapher/Models/AccelGUI.cs b/grapher/Models/AccelGUI.cs index c6a2dcc..5c25813 100644 --- a/grapher/Models/AccelGUI.cs +++ b/grapher/Models/AccelGUI.cs @@ -141,7 +141,8 @@ namespace grapher modes = ApplyOptions.GetModes(), args = newArgs, minimumTime = driverSettings.minimumTime, - directionalMultipliers = driverSettings.directionalMultipliers + directionalMultipliers = driverSettings.directionalMultipliers, + deviceHardwareID = driverSettings.deviceHardwareID }; ButtonDelay(WriteButton); -- cgit v1.2.3 From 8273ecf0c22876f0f4e9dfa9eb29b9d491614faa Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Thu, 7 Jan 2021 23:11:24 -0800 Subject: Refactor --- grapher/Models/AccelGUI.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'grapher/Models/AccelGUI.cs') diff --git a/grapher/Models/AccelGUI.cs b/grapher/Models/AccelGUI.cs index 5c25813..9f97eed 100644 --- a/grapher/Models/AccelGUI.cs +++ b/grapher/Models/AccelGUI.cs @@ -1,4 +1,5 @@ using grapher.Models.Calculations; +using grapher.Models.Devices; using grapher.Models.Mouse; using grapher.Models.Options; using grapher.Models.Serialized; @@ -23,7 +24,8 @@ namespace grapher Button writeButton, ButtonBase toggleButton, MouseWatcher mouseWatcher, - ToolStripMenuItem scaleMenuItem) + ToolStripMenuItem scaleMenuItem, + DeviceIDManager deviceIDManager) { AccelForm = accelForm; AccelCalculator = accelCalculator; @@ -36,6 +38,7 @@ namespace grapher DefaultButtonFont = WriteButton.Font; SmallButtonFont = new Font(WriteButton.Font.Name, WriteButton.Font.Size * Constants.SmallButtonSizeFactor); MouseWatcher = mouseWatcher; + DeviceIDManager = deviceIDManager; ScaleMenuItem.Click += new System.EventHandler(OnScaleMenuItemClick); WriteButton.Click += new System.EventHandler(OnWriteButtonClick); @@ -95,6 +98,8 @@ namespace grapher public ToolStripMenuItem ScaleMenuItem { get; } + public DeviceIDManager DeviceIDManager { get; } + private Timer ChartRefresh { get; } private Font SmallButtonFont { get; } @@ -142,7 +147,7 @@ namespace grapher args = newArgs, minimumTime = driverSettings.minimumTime, directionalMultipliers = driverSettings.directionalMultipliers, - deviceHardwareID = driverSettings.deviceHardwareID + deviceHardwareID = DeviceIDManager.HWID, }; ButtonDelay(WriteButton); -- cgit v1.2.3 From 0e60e22b73dd0693b349cbb63cf9a390c01fd5dd Mon Sep 17 00:00:00 2001 From: a1xd <68629610+a1xd@users.noreply.github.com> Date: Tue, 12 Jan 2021 17:01:18 -0500 Subject: filter raw input based on id use device id (from device instance) over first hardware id use buffered method for all ioctls update gui/DeviceIDManager to match driver behavior respond to device change events desync MouseData and PointData accessors --- grapher/Models/AccelGUI.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'grapher/Models/AccelGUI.cs') diff --git a/grapher/Models/AccelGUI.cs b/grapher/Models/AccelGUI.cs index 9f97eed..81b3e13 100644 --- a/grapher/Models/AccelGUI.cs +++ b/grapher/Models/AccelGUI.cs @@ -100,6 +100,8 @@ namespace grapher public DeviceIDManager DeviceIDManager { get; } + public Action UpdateInputManagers { get; private set; } + private Timer ChartRefresh { get; } private Font SmallButtonFont { get; } @@ -147,7 +149,7 @@ namespace grapher args = newArgs, minimumTime = driverSettings.minimumTime, directionalMultipliers = driverSettings.directionalMultipliers, - deviceHardwareID = DeviceIDManager.HWID, + deviceID = DeviceIDManager.ID, }; ButtonDelay(WriteButton); @@ -168,6 +170,14 @@ namespace grapher { UpdateShownActiveValues(args); UpdateGraph(args); + + UpdateInputManagers = () => + { + MouseWatcher.UpdateHandles(args.deviceID); + DeviceIDManager.Update(args.deviceID); + }; + + UpdateInputManagers(); } public void UpdateGraph(DriverSettings args) -- cgit v1.2.3