StreamDeck.Net
0.2.0
dotnet add package StreamDeck.Net --version 0.2.0
NuGet\Install-Package StreamDeck.Net -Version 0.2.0
<PackageReference Include="StreamDeck.Net" Version="0.2.0" />
paket add StreamDeck.Net --version 0.2.0
#r "nuget: StreamDeck.Net, 0.2.0"
// Install StreamDeck.Net as a Cake Addin #addin nuget:?package=StreamDeck.Net&version=0.2.0 // Install StreamDeck.Net as a Cake Tool #tool nuget:?package=StreamDeck.Net&version=0.2.0
StreamDeck.NET
A .NET Core wrapper for the Elgato StreamDeck SDK
NOTE: This project is still in the early stages of development.
StreamDeck.Net provides an events based .NET Core wrapper around the Elgato Stream Deck
Table of Contents
Sample program
Below shows how StreamDeck.NET can be used to create a simple counter action. It uses natemcmaster's excellent CommandLineUtils for parsing command line arguments.
namespace Counter
{
public class Program
{
[Option(Description = "The port the Elgato StreamDeck software is listening on", ShortName = "port")]
public string Port { get; set; }
[Option(Description = "The Unique Identifier used to reference the plugin", ShortName = "pluginUUID")]
public string PluginUuid { get; set; }
[Option(Description = "Event type used to register the plugin", ShortName = "registerEvent")]
public string RegisterEvent { get; set; }
[Option(Description = "String of JSON containing appliaction and device information", ShortName = "info")]
public string Info { get; set; }
public static Task<int> Main(string[] args) => CommandLineApplication.ExecuteAsync<Program>(args);
private async Task OnExecuteAsync()
{
var cancellationTokenSource = new CancellationTokenSource();
var streamDeck = new StreamDeckClient(Port, PluginUuid, RegisterEvent, Info);
streamDeck.KeyDownEventAsync += UpdateCounter;
await streamDeck.RunAsync(cancellationTokenSource.Token);
}
private static int _counter;
private static async Task UpdateCounter(StreamDeckClient client, StreamDeckEventPayload args)
{
_counter++;
await client.SetTitle(args.Context, _counter.ToString());
}
}
}
Install
dotnet add package StreamDeck.Net
For ease of debuugging you can set your plugins local publish profiles to point to the StreamDeck softwares plugin folder. Then you can just re-run the software and attach to process to step through your code.
Thanks
A special thanks to Jeffrey T. Fritz (@csharpfritz) whose stream inspired this project. The code he implemented in StreamDeck_First was initially used as the base for this project before undergoing heavy refactoring.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.0 is compatible. netcoreapp3.1 was computed. |
-
.NETCoreApp 3.0
- Newtonsoft.Json (>= 12.0.1)
- System.IO.Pipelines (>= 4.5.3)
- System.Net.WebSockets (>= 4.3.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
0.2.0 | 861 | 1/11/2019 |