Skip to content

Commit acfb336

Browse files
authored
Added Mouse Wheel support
Taken from xyning fork
1 parent f19de45 commit acfb336

File tree

7 files changed

+134
-60
lines changed

7 files changed

+134
-60
lines changed

TabletDriverGUI/Configuration.cs

+3
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public enum OutputModes
5050
[XmlArrayItem("Button")]
5151
public int[] ButtonMap;
5252
public bool DisableButtons;
53+
public int mouseWheelSpeed;
5354

5455
[XmlArray("CommandsAfter")]
5556
[XmlArrayItem("Command")]
@@ -90,6 +91,7 @@ public Configuration()
9091

9192
ButtonMap = new int[] { 1, 2, 3 };
9293
DisableButtons = false;
94+
mouseWheelSpeed = 50;
9395

9496
SmoothingEnabled = false;
9597
SmoothingLatency = 0;
@@ -117,6 +119,7 @@ public Configuration()
117119

118120
DriverPath = "bin/TabletDriverService.exe";
119121
DriverArguments = "config/init.cfg";
122+
120123
DeveloperMode = false;
121124
}
122125

TabletDriverGUI/MainWindow.xaml

+10-2
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,14 @@
307307

308308
<StackPanel Orientation="Horizontal" VerticalAlignment="Top">
309309

310+
<!-- Mouse Speed -->
311+
<GroupBox Header="Mouse Wheel Speed" VerticalAlignment="Top" HorizontalAlignment="Left" Width="130" Height="45">
312+
<TextBox Name="textMouseWheelSpeed"
313+
Padding="4,-1,0,0"
314+
HorizontalContentAlignment="Left" VerticalContentAlignment="Center"
315+
TextChanged="TextChanged">50</TextBox>
316+
</GroupBox>
317+
310318
<!-- Tip -->
311319
<GroupBox Header="Tip" VerticalAlignment="Top" HorizontalAlignment="Left" Width="90">
312320
<ComboBox Name="comboBoxButton1" SelectionChanged="ItemSelectionChanged">
@@ -337,8 +345,8 @@
337345

338346

339347
<!-- Smoothing -->
340-
<StackPanel Orientation="Horizontal">
341-
<GroupBox Name="groupFilter" Header="Smoothing Filter" VerticalAlignment="Bottom" Margin="5,0,0,0" HorizontalAlignment="Left">
348+
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
349+
<GroupBox Name="groupFilter" Header="Smoothing Filter" VerticalAlignment="Bottom" HorizontalAlignment="Center">
342350
<GroupBox.ToolTip>
343351
<StackPanel>
344352
<TextBlock FontWeight="Bold">

TabletDriverGUI/MainWindow.xaml.cs

+9-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public partial class MainWindow : Window
2424
{
2525

2626
// Version
27-
public string Version = "0.1.5.4 Devocub Edition";
27+
public string Version = "0.1.5.5 Devocub Edition";
2828

2929
// Console stuff
3030
private List<string> commandHistory;
@@ -174,6 +174,8 @@ public MainWindow()
174174
comboBoxButton2.Items.Add("Mouse " + i);
175175
comboBoxButton3.Items.Add("Mouse " + i);
176176
}
177+
comboBoxButton2.Items.Add("Mouse Wheel");
178+
comboBoxButton3.Items.Add("Mouse Wheel");
177179
comboBoxButton1.SelectedIndex = 0;
178180
comboBoxButton2.SelectedIndex = 0;
179181
comboBoxButton3.SelectedIndex = 0;
@@ -463,6 +465,7 @@ private void LoadSettingsFromConfiguration()
463465
//
464466
if (config.ButtonMap.Count() == 3)
465467
{
468+
textMouseWheelSpeed.Text = Utils.GetNumberString(config.mouseWheelSpeed);
466469
comboBoxButton1.SelectedIndex = config.ButtonMap[0];
467470
comboBoxButton2.SelectedIndex = config.ButtonMap[1];
468471
comboBoxButton3.SelectedIndex = config.ButtonMap[2];
@@ -671,6 +674,8 @@ private void UpdateSettingsToConfiguration()
671674

672675

673676
// Button map
677+
if (Utils.ParseNumber(textMouseWheelSpeed.Text, out val))
678+
config.mouseWheelSpeed = (int)val;
674679
config.ButtonMap[0] = comboBoxButton1.SelectedIndex;
675680
config.ButtonMap[1] = comboBoxButton2.SelectedIndex;
676681
config.ButtonMap[2] = comboBoxButton3.SelectedIndex;
@@ -1804,6 +1809,9 @@ private void SendSettingsToDriver()
18041809
driver.SendCommand("ButtonMap " + String.Join(" ", config.ButtonMap));
18051810
}
18061811

1812+
// Mouse Wheel Speed
1813+
driver.SendCommand("MouseWheelSpeed " + Utils.GetNumberString(config.mouseWheelSpeed));
1814+
18071815
// Smoothing filter
18081816
if (config.SmoothingEnabled)
18091817
{

0 commit comments

Comments
 (0)