Skip to content

Commit dbcbb58

Browse files
committed
VEIKK A50, Wacom CTL-6100, multiple areas, filter improvements, etc.
- Added VEIKK A50 configuration. Tablet buttons from 9 to 13 are the touchpad gestures - Added Wacom CTL-6100 configuration - Added support for multiple tablet areas (suggested by Devocub). Right-click the area for more options - Added preset selector to the anti-smoothing and noise reduction filters - Added advanced smoothing filter (no GUI settings yet) - Added a tablet view tool that can be used to check how much filters are reducing or increasing the input latency (Menu->Tools->Tablet View) - Added force proportions button to Wacom area tool - Added 19 new tablets to wacom.cfg - Added precise volume control to button maps. Example custom mapping: VOLUMEUP0.5 - Improved anti-smoothing filter - Improved smoothing filter latency calculation. Latency is now higher if you use same latency value as with the older driver version - System timer resolution will now be modified to match with the smoothing filter rate - Relative positioning can now be used with every output mode - On Windows 7 the driver is now using SendInput as a standard output mode, so multiple monitors should work without changing the output mode - Windows Ink pressure deadzone can now be set separately for low and high pressure - The TabletDriverGUI now communicates with the driver through named pipes
1 parent e041d9f commit dbcbb58

File tree

83 files changed

+9614
-2142
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+9614
-2142
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@
55
/TabletDriverGUI/obj/
66
/TabletDriverService/Release/
77
/TabletDriverService/Debug/
8-
/TabletDriverService/startuplog.txt
8+
/TabletDriverService/startuplog.txt
9+
TabletDriverService/config/usersettings.cfg

TabletDriverGUI/App.xaml.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,16 @@ public App()
127127
}
128128
else
129129
{
130+
MessageBox.Show("TabletDriverGUI is already open!");
131+
130132
// Broadcast to the another instance to show itself
131133
NativeMethods.PostMessage(
132-
(IntPtr)NativeMethods.HWND_BROADCAST,
133-
NativeMethods.WM_SHOWTABLETDRIVERGUI,
134-
IntPtr.Zero,
135-
IntPtr.Zero);
134+
(IntPtr)NativeMethods.HWND_BROADCAST,
135+
NativeMethods.WM_SHOWTABLETDRIVERGUI,
136+
IntPtr.Zero,
137+
IntPtr.Zero
138+
);
139+
136140
Shutdown();
137141
}
138142
}

TabletDriverGUI/Area.cs

Lines changed: 83 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,29 @@ public double Rotation
4343
{
4444
double angle;
4545
_rotation = value;
46+
4647
angle = _rotation * Math.PI / 180;
48+
4749
_rotationMatrix[0] = Math.Cos(angle);
4850
_rotationMatrix[1] = Math.Sin(angle);
4951
_rotationMatrix[2] = -Math.Sin(angle);
5052
_rotationMatrix[3] = Math.Cos(angle);
53+
5154
UpdateCorners();
5255
}
5356
}
57+
public bool IsEnabled;
58+
59+
5460

5561
private double _rotation;
56-
private double[] _rotationMatrix;
62+
private readonly double[] _rotationMatrix;
63+
private readonly Point[] _corners;
5764

58-
private Point[] _corners;
5965

66+
//
67+
// Constructors
68+
//
6069
public Area()
6170
{
6271
_corners = new Point[4] {
@@ -67,11 +76,11 @@ public Area()
6776
};
6877
_rotation = 0;
6978
_rotationMatrix = new double[4] { 1, 0, 0, 1 };
70-
7179
_width = 0;
7280
_height = 0;
7381
X = 0;
7482
Y = 0;
83+
IsEnabled = false;
7584

7685
}
7786
public Area(double width, double height, double x, double y) : this()
@@ -80,10 +89,26 @@ public Area(double width, double height, double x, double y) : this()
8089
_height = height;
8190
X = x;
8291
Y = y;
92+
IsEnabled = false;
8393
UpdateCorners();
8494
}
8595

96+
//
97+
// Copy values from an another area
98+
//
99+
public void Set(Area area)
100+
{
101+
X = area.X;
102+
Y = area.Y;
103+
Width = area.Width;
104+
Height = area.Height;
105+
Rotation = area.Rotation;
106+
IsEnabled = area.IsEnabled;
107+
}
86108

109+
//
110+
// Update corner positions
111+
//
87112
private void UpdateCorners()
88113
{
89114
GetRotatedPoint(ref _corners[0], -_width / 2.0, -_height / 2.0);
@@ -92,20 +117,54 @@ private void UpdateCorners()
92117
GetRotatedPoint(ref _corners[3], -_width / 2.0, _height / 2.0);
93118
}
94119

120+
//
121+
// Rotate point
122+
//
95123
public void GetRotatedPoint(ref Point p, double x, double y)
96124
{
97125
p.X = x * _rotationMatrix[0] + y * _rotationMatrix[1];
98126
p.Y = x * _rotationMatrix[2] + y * _rotationMatrix[3];
99127
}
100128

101129
//
130+
// Rotate point in reverse direction
102131
//
132+
public void GetRotatedPointReverse(ref Point p, double x, double y)
133+
{
134+
p.X = x * _rotationMatrix[3] - y * _rotationMatrix[1];
135+
p.Y = x * -_rotationMatrix[2] + y * _rotationMatrix[0];
136+
}
137+
138+
139+
//
140+
// Check if a point is inside of the area
103141
//
104-
public Point[] Corners
142+
public bool IsInside(Point p)
105143
{
106-
get { return _corners; }
144+
double x1, y1, x2, y2;
145+
146+
x1 = p.X - X;
147+
y1 = p.Y - Y;
148+
x2 = x1 * _rotationMatrix[0] + y1 * _rotationMatrix[1];
149+
y2 = x1 * _rotationMatrix[2] + y1 * _rotationMatrix[3];
150+
151+
if (
152+
x2 > -Width / 2.0 &&
153+
x2 < +Width / 2.0 &&
154+
y2 > -Height / 2.0 &&
155+
y2 < +Height / 2.0
156+
)
157+
{
158+
return true;
159+
}
160+
161+
return false;
107162
}
108163

164+
//
165+
// Get corners
166+
//
167+
public Point[] Corners => _corners;
109168

110169
//
111170
// Bounding Box
@@ -128,6 +187,7 @@ public double[] GetBoundingBox()
128187
return box;
129188
}
130189

190+
131191
//
132192
// Scale to fit inside another area
133193
//
@@ -146,6 +206,9 @@ public void ScaleInside(Area target)
146206
UpdateCorners();
147207
}
148208

209+
//
210+
// Move area position inside of another area
211+
//
149212
public void MoveInside(Area target)
150213
{
151214
double[] box = GetBoundingBox();
@@ -161,5 +224,20 @@ public void MoveInside(Area target)
161224
Y = target.Y + targetBox[3] - box[3];
162225
}
163226

227+
228+
//
229+
// Convert to string
230+
//
231+
public override string ToString()
232+
{
233+
return
234+
"Area[" +
235+
Utils.GetNumberString(X) + "," +
236+
Utils.GetNumberString(Y) + "," +
237+
Utils.GetNumberString(Width) + "," +
238+
Utils.GetNumberString(Height) +
239+
"]";
240+
}
241+
164242
}
165243
}

0 commit comments

Comments
 (0)