diff options
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) |