Skip to content

Commit d9a5534

Browse files
committedDec 16, 2024
Update to use dialUp and dialDown from SD 6.1
1 parent 1d3d772 commit d9a5534

File tree

6 files changed

+25
-16
lines changed

6 files changed

+25
-16
lines changed
 

‎.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "SharpDeck"]
2+
path = SharpDeck
3+
url = https://github.com/nguyenquyhy/SharpDeck

‎FlightStreamDeck.AddOn/manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,6 @@
437437
}
438438
],
439439
"Software": {
440-
"MinimumVersion": "4.1"
440+
"MinimumVersion": "6.1"
441441
}
442442
}

‎FlightStreamDeck.Logics/Actions/BaseAction.cs

+13-14
Original file line numberDiff line numberDiff line change
@@ -86,27 +86,26 @@ public async Task SetFeedbackSafeAsync(object feedback)
8686

8787
protected virtual Task OnDialLongPress(ActionEventArgs<DialPayload> args) => Task.CompletedTask;
8888

89-
protected override Task OnDialPress(ActionEventArgs<DialPayload> args)
89+
protected override Task OnDialDown(ActionEventArgs<DialPayload> args)
9090
{
91-
if (args.Payload.Pressed)
91+
DialPressStack.Push(args);
92+
if (LongKeyPressInterval > TimeSpan.Zero)
9293
{
93-
DialPressStack.Push(args);
94-
if (LongKeyPressInterval > TimeSpan.Zero)
94+
Task.Run(async delegate
9595
{
96-
Task.Run(async delegate
97-
{
98-
await Task.Delay(LongKeyPressInterval);
99-
TryHandleDialPress(OnDialLongPress);
100-
});
101-
}
102-
}
103-
else
104-
{
105-
TryHandleDialPress(OnDialShortPress);
96+
await Task.Delay(LongKeyPressInterval);
97+
TryHandleDialPress(OnDialLongPress);
98+
});
10699
}
107100
return Task.CompletedTask;
108101
}
109102

103+
protected override Task OnDialUp(ActionEventArgs<DialPayload> args)
104+
{
105+
TryHandleDialPress(OnDialShortPress);
106+
return Task.CompletedTask;
107+
}
108+
110109
private void TryHandleDialPress(Func<ActionEventArgs<DialPayload>, Task> handler)
111110
{
112111
if (DialPressStack.TryPop(out var result))

‎FlightStreamDeck.Logics/FlightStreamDeck.Logics.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="SharpDeck" Version="7.0.0-beta1" />
1110
<PackageReference Include="SixLabors.ImageSharp.Drawing" Version="2.1.4" />
1211
</ItemGroup>
1312

1413
<ItemGroup>
1514
<ProjectReference Include="..\FlightStreamDeck.Core\FlightStreamDeck.Core.csproj" />
15+
<ProjectReference Include="..\SharpDeck\src\SharpDeck\SharpDeck.csproj" />
1616
</ItemGroup>
1717

1818
</Project>

‎FlightStreamDeck.sln

+6
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FlightStreamDeck.Core", "Fl
2222
EndProject
2323
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FlightStreamDeck.LogicsTests", "FlightStreamDeck.LogicsTests\FlightStreamDeck.LogicsTests.csproj", "{2476F8A1-5018-414A-AF30-D75C7B189C25}"
2424
EndProject
25+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDeck", "SharpDeck\src\SharpDeck\SharpDeck.csproj", "{56FE4160-9205-44D5-A70C-F31B5D42B53A}"
26+
EndProject
2527
Global
2628
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2729
Debug|Any CPU = Debug|Any CPU
@@ -48,6 +50,10 @@ Global
4850
{2476F8A1-5018-414A-AF30-D75C7B189C25}.Debug|Any CPU.Build.0 = Debug|Any CPU
4951
{2476F8A1-5018-414A-AF30-D75C7B189C25}.Release|Any CPU.ActiveCfg = Release|Any CPU
5052
{2476F8A1-5018-414A-AF30-D75C7B189C25}.Release|Any CPU.Build.0 = Release|Any CPU
53+
{56FE4160-9205-44D5-A70C-F31B5D42B53A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
54+
{56FE4160-9205-44D5-A70C-F31B5D42B53A}.Debug|Any CPU.Build.0 = Debug|Any CPU
55+
{56FE4160-9205-44D5-A70C-F31B5D42B53A}.Release|Any CPU.ActiveCfg = Release|Any CPU
56+
{56FE4160-9205-44D5-A70C-F31B5D42B53A}.Release|Any CPU.Build.0 = Release|Any CPU
5157
EndGlobalSection
5258
GlobalSection(SolutionProperties) = preSolution
5359
HideSolutionNode = FALSE

‎SharpDeck

Submodule SharpDeck added at 3bffaab

0 commit comments

Comments
 (0)