diff options
| author | a1xd <[email protected]> | 2021-01-14 12:27:42 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-01-14 12:27:42 -0500 |
| commit | 9ea8b4b94bba795eb5060b376baa8e5169e80272 (patch) | |
| tree | 493bfaeb2b59b7db452c52e9ec9713e8b8296510 /grapher/Models/AccelGUI.cs | |
| parent | Merge pull request #53 from termhn/patch-1 (diff) | |
| parent | filter raw input based on id (diff) | |
| download | rawaccel-9ea8b4b94bba795eb5060b376baa8e5169e80272.tar.xz rawaccel-9ea8b4b94bba795eb5060b376baa8e5169e80272.zip | |
Merge pull request #59 from aroidzap/apply-for-specific-device-gui
(GUI) Apply RawAccel only for specific device
Diffstat (limited to 'grapher/Models/AccelGUI.cs')
| -rw-r--r-- | grapher/Models/AccelGUI.cs | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/grapher/Models/AccelGUI.cs b/grapher/Models/AccelGUI.cs index c6a2dcc..81b3e13 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,10 @@ namespace grapher public ToolStripMenuItem ScaleMenuItem { get; } + public DeviceIDManager DeviceIDManager { get; } + + public Action UpdateInputManagers { get; private set; } + private Timer ChartRefresh { get; } private Font SmallButtonFont { get; } @@ -141,7 +148,8 @@ namespace grapher modes = ApplyOptions.GetModes(), args = newArgs, minimumTime = driverSettings.minimumTime, - directionalMultipliers = driverSettings.directionalMultipliers + directionalMultipliers = driverSettings.directionalMultipliers, + deviceID = DeviceIDManager.ID, }; ButtonDelay(WriteButton); @@ -162,6 +170,14 @@ namespace grapher { UpdateShownActiveValues(args); UpdateGraph(args); + + UpdateInputManagers = () => + { + MouseWatcher.UpdateHandles(args.deviceID); + DeviceIDManager.Update(args.deviceID); + }; + + UpdateInputManagers(); } public void UpdateGraph(DriverSettings args) |