Skip to content

Commit 8f91f10

Browse files
authored
Merge pull request #16 from Kuuuube/master
Add tooltips
2 parents fadc658 + 95ded30 commit 8f91f10

File tree

3 files changed

+101
-13
lines changed

3 files changed

+101
-13
lines changed

DevocubFilters/AntiChatter.cs

Lines changed: 72 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,43 +12,104 @@ namespace TabletDriverFilters.Devocub
1212
[PluginName("Devocub Antichatter")]
1313
public class Antichatter : Interpolator
1414
{
15+
private const string LATENCY_TOOLTIP =
16+
"Smoothing latency\n"
17+
+ " - Smoothing filter adds latency to the input, so don't enable it if you want to have the lowest possible input lag.\n"
18+
+ " - On Wacom tablets you can use latency value between 15 and 25 to have a similar smoothing as in the Wacom drivers.\n"
19+
+ " - You can test out different filter values, but the recommended maximum for osu! is around 50 milliseconds.\n"
20+
+ " - Filter latency values lower than 4 milliseconds aren't recommended. Its better to disable the smoothing filter.\n"
21+
+ " - You don't have to change the filter frequency, but you can use the highest frequency your computer can run without performance problems.";
22+
private const string ANTICHATTER_TOOLTIP =
23+
"Antichatter is meant to prevent cursor chattering/rattling/shaking/trembling when the pen doesn't move.\n"
24+
+ " - Antichatter in its primary form is useful for tablets which don't have any hardware smoothing.\n"
25+
+ " - Antichatter uses smoothing. Latency and Frequency values do have an effect on antichatter settings.\n"
26+
+ "\n"
27+
+ "Formula for smoothing is:\n"
28+
+ " y(x) = (x + OffsetX)^(Strength*-1)*Multiplier+OffsetY\n"
29+
+ " - Where x is pen speed. And y(x) is the smoothing value. Slower speed = more smoothing. Faster speed = less smoothing.\n"
30+
+ "\n"
31+
+ "Strength : Useful values are from 1 up to 10. Higher values make smoothing sharper, lower are smoother.\n"
32+
+ "Multiplier : Zooms in and zooms out the plot. Useful values are from 1 up to 1000. Makes smoothing softer. Default value is 1, which causes no change.\n"
33+
+ "Offset X : Moves the plot to the right. Negative values move the plot to the left. Higher values make smoothing weaker,\n"
34+
+ " lower values stronger and activate stronger smoothing earlier in terms of cursor speed). Useful values are from -1 to 2. Default values is 0.\n"
35+
+ "Offset Y : Moves the plot up. Useful values are from roughly -1 up to 10. If the Y value of smoothing is near 0 for any given point then it provides almost raw data with lowest delay.\n"
36+
+ " If value is near 1 then it's usual smoothing, also it defines minimal amount of smoothing. OffsetY 10 will make smoothing 10 times stronger.\n"
37+
+ " OffsetY 0.5 will make smoothing roughly twice as weak (and latency will be roughly half), 0.3 roughly one third weaker, etc. The default value is 1.\n"
38+
+ "\n"
39+
+ "Example Settings:\n"
40+
+ " - Simple: Latency 5-50 ms, Strength 2-3, Multiplier 1, OffsetX 0, OffsetY 1.\n"
41+
+ "\n"
42+
+ " - Straight: Latency 20-40ms, Strength 20, Multiplier 1, OffsetX 0.7, OffsetY 0.6. This preset isn't good for high hovering.\n"
43+
+ "\n"
44+
+ " - Smooth: Latency ~10 ms, Strength 3, Multiplier 100, OffsetX 1.5, OffsetY 1.\n"
45+
+ " Change OffsetX between 0-2 to switch between stickiness and smooth.\n"
46+
+ " Increase Strength to 4-10 to get harper. Decrease Strength to 1-2 to get more smoothing.\n"
47+
+ "\n"
48+
+ " - Low latency: Set Offset Y to 0 (and potentially set Latency to 1-10 ms. However, with some settings this can break smoothing, usually OffsetY 0 is enough to being able to go to lowest latency).";
49+
private const string PREDICTION_TOOLTIP =
50+
"Prediction - How it works: It adds a predicted point to smoothing algorithm. It helps to preserve sharpness of movement, helps with small movements,\n"
51+
+ " Low values (~10-15ms) of smoothing latency can cause problems for cursor movement. It's very preferred to use at least 10-15ms of smoothing latency, 20-40 ms is even better and recommended.\n"
52+
+ " In some cases, cursor can even outdistance real position (similar to Wacom 6.3.95 drivers).\n"
53+
+ "\n"
54+
+ "Formula for prediction is:\n"
55+
+ " y(x) = 1/cosh((x-OffsetX)*Sharpness)*Strength+OffsetY\n"
56+
+ " - Where x is pen speed. And y(x) is strength of prediction\n"
57+
+ "\n"
58+
+ "Strength : is max of peak of prediction. Useful values are from 0 to 2, or up to 3-4 depending on latency.\n"
59+
+ "Sharpness : changes the width of the Strength.\n"
60+
+ "Offset X : center of the prediction's peak. Useful values are from 0.5 up to 5-7, Increasing this value will shift the cursor speed up on bigger movements.\n"
61+
+ "Offset Y : Moves the plot up/down (positive/negative values). Also defines the minimum amount of prediction.\n"
62+
+ "\n"
63+
+ "Example Settings:\n"
64+
+ " Simple+:\n"
65+
+ " Straight or Smooth preset for smoothing\n"
66+
+ " Strength 1-3 (for 5-50 ms respectively), Sharpness 1, OffsetX 0.8, OffsetY 0\n"
67+
+ "\n"
68+
+ " Straight+:\n"
69+
+ " Straight preset for smoothing\n"
70+
+ " Strength 0.3, Sharpness 0.7, OffsetX 2, OffsetY 0.3\n"
71+
+ "\n"
72+
+ " Fun:\n"
73+
+ " Smoothing: Latency 40ms, Strength 3, Multiplier 10, OffsetX 1, OffsetY 1\n"
74+
+ " Prediction: Strength 4, Sharpness 0.75, Offset 2.5, OffsetY 1";
75+
1576
public Antichatter(ITimer scheduler) : base(scheduler)
1677
{
1778
GetMMScale();
1879
}
1980

20-
[SliderProperty("Latency", 0f, 1000f, 2f), DefaultPropertyValue(2f)]
81+
[SliderProperty("Latency", 0f, 1000f, 2f), DefaultPropertyValue(2f), ToolTip(LATENCY_TOOLTIP)]
2182
public float Latency
2283
{
2384
set => this.latency = Math.Clamp(value, 0, 1000);
2485
get => this.latency;
2586
}
2687

27-
[Property("Antichatter Strength"), DefaultPropertyValue(3f)]
88+
[Property("Antichatter Strength"), DefaultPropertyValue(3f), ToolTip(ANTICHATTER_TOOLTIP)]
2889
public float AntichatterStrength { set; get; }
2990

30-
[Property("Antichatter Multiplier"), DefaultPropertyValue(1f)]
91+
[Property("Antichatter Multiplier"), DefaultPropertyValue(1f), ToolTip(ANTICHATTER_TOOLTIP)]
3192
public float AntichatterMultiplier { set; get; }
3293

33-
[Property("Antichatter Offset X")]
94+
[Property("Antichatter Offset X"), ToolTip(ANTICHATTER_TOOLTIP)]
3495
public float AntichatterOffsetX { set; get; }
3596

36-
[Property("Antichatter Offset Y"), DefaultPropertyValue(1f)]
97+
[Property("Antichatter Offset Y"), DefaultPropertyValue(1f), ToolTip(ANTICHATTER_TOOLTIP)]
3798
public float AntichatterOffsetY { set; get; }
3899

39-
[BooleanProperty("Prediction", "")]
40-
public bool PredictionEnabled { set; get; }
100+
[BooleanProperty("Prediction", ""), ToolTip(PREDICTION_TOOLTIP)]
41101

42-
[Property("Prediction Strength"), DefaultPropertyValue(1.1f)]
102+
public bool PredictionEnabled { set; get; }
103+
[Property("Prediction Strength"), DefaultPropertyValue(1.1f), ToolTip(PREDICTION_TOOLTIP)]
43104
public float PredictionStrength { set; get; }
44105

45-
[Property("Prediction Sharpness"), DefaultPropertyValue(1f)]
106+
[Property("Prediction Sharpness"), DefaultPropertyValue(1f), ToolTip(PREDICTION_TOOLTIP)]
46107
public float PredictionSharpness { set; get; }
47108

48-
[Property("Prediction Offset X"), DefaultPropertyValue(3f)]
109+
[Property("Prediction Offset X"), DefaultPropertyValue(3f), ToolTip(PREDICTION_TOOLTIP)]
49110
public float PredictionOffsetX { set; get; }
50111

51-
[Property("Prediction Offset Y"), DefaultPropertyValue(0.3f)]
112+
[Property("Prediction Offset Y"), DefaultPropertyValue(0.3f), ToolTip(PREDICTION_TOOLTIP)]
52113
public float PredictionOffsetY { set; get; }
53114

54115
private const float THRESHOLD = 0.9f;

HawkuFilters/NoiseReduction.cs

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,29 @@ namespace OpenTabletDriver.Plugin
99
[PluginName("Hawku Noise Reduction")]
1010
public class NoiseReduction : IFilter
1111
{
12+
private const string NOISEREDUCTION_TOOLTIP =
13+
"Noise Reduction Filter:\n"
14+
+ " WARNING! This filter will cause more latency on smaller tablet areas(<20 mm), so consider using a larger area to increase the performance.\n"
15+
+ "\n"
16+
+ "Buffer:\n"
17+
+ " - Buffer value is how many of the last pen positions will be stored in the buffer.\n"
18+
+ " - Lower buffer value means lower latency, but lower noise reduction.\n"
19+
+ " - At 133 RPS, the buffer size of 10 means a maximum latency of 75 milliseconds.\n"
20+
+ "\n"
21+
+ "Threshold:\n"
22+
+ " - Threshold value sets the movement distance threshold per pen position report.\n"
23+
+ " - The amount of noise reduction will be at it's maximum if the pen movement is shorter than the threshold value.\n"
24+
+ " - Noise reduction and latency will be almost zero if the pen position movement is double the distance of the threshold value.\n"
25+
+ " - At 133 RPS, a threshold value of 0.5 mm means for speeds of ~66.5 mm/s noise reduction and latency will be applied but for ~133 mm/s the noise reduction and latency will be near zero.\n"
26+
+ "\n"
27+
+ "Recommendations:\n"
28+
+ " Samples = 5 - 20, Threshold = 0.2 - 1.0 mm.";
1229
public NoiseReduction()
1330
{
1431
GetMMScale();
1532
}
1633

17-
[Property("Buffer"), DefaultPropertyValue(10)]
34+
[Property("Buffer"), DefaultPropertyValue(10), ToolTip(NOISEREDUCTION_TOOLTIP)]
1835
public int Samples
1936
{
2037
set
@@ -25,7 +42,7 @@ public int Samples
2542
get => this.samples;
2643
}
2744

28-
[Property("Distance Threshold"), Unit("mm"), DefaultPropertyValue(0.5f)]
45+
[Property("Distance Threshold"), Unit("mm"), DefaultPropertyValue(0.5f), ToolTip(NOISEREDUCTION_TOOLTIP)]
2946
public float DistanceThreshold
3047
{
3148
set

HawkuFilters/Smoothing.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@ public Smoothing(ITimer scheduler) : base(scheduler)
1616
}
1717

1818
[SliderProperty("Latency", 0.0f, 1000.0f, 2.0f), DefaultPropertyValue(2f)]
19+
[ToolTip(
20+
"Smoothing Filter\n"
21+
+ " - Smoothing filter adds latency to the input, so don't enable it if you want the lowest possible input latency.\n"
22+
+ "\n"
23+
+ "Recommendations\n"
24+
+ " - On Wacom tablets you can use latency value between 15 and 25 to have a similar smoothing as in the Wacom drivers.\n"
25+
+ " - You can test out different filter values, but recommended maximum for osu! is around 50 milliseconds.\n"
26+
+ " - Filter latency value lower than 4 milliseconds isn't recommended. Its better to just disable the smoothing filter.\n"
27+
+ " - You don't have to change the filter frequency, but you can use the highest frequency your computer can run without performance problems."
28+
)]
1929
public float Latency { set; get; }
2030

2131
private const float THRESHOLD = 0.63f;

0 commit comments

Comments
 (0)