An open API service indexing awesome lists of open source software.

https://github.com/geekyeggo/sharpdeck

A .NET wrapper for the official Elgato Stream Deck SDK.
https://github.com/geekyeggo/sharpdeck

dotnetstandard elgato streamdeck streamdeck-sdk

Last synced: 10 months ago
JSON representation

A .NET wrapper for the official Elgato Stream Deck SDK.

Awesome Lists containing this project

README

          

[![SharpDeck verion on NuGet.org](https://img.shields.io/nuget/v/SharpDeck.svg)](https://www.nuget.org/packages/SharpDeck/)
[![Build status](https://github.com/GeekyEggo/SharpDeck/workflows/build/badge.svg)](https://github.com/GeekyEggo/SharpDeck/actions?query=workflow%3Abuild)

# SharpDeck

A comprehensive .NET wrapper for creating Stream Deck plugins, using the official Stream Deck SDK documentation. SharpDeck takes the hassle out of communicating with the Stream Deck SDK, and handles action caching and event delegation.

## 📦 Examples

* [Counter](/examples/Counter) - Single action counter plugin.
* [Shared Counter](/examples/SharedCounter) - Multiple action plugin with a shared counter and reset.

## ✏️ Creating a plugin

SharpDeck enables console applications to easily communicate with Stream Deck; run `dotnet new console` to create a .NET console application, and follow these five steps to create your first Stream Deck plugin.

### 🔗 1. Program.cs

```csharp
public static void Main(string[] args)
{
#if DEBUG
System.Diagnostics.Debugger.Launch();
#endif

// Connect to Stream Deck.
SharpDeck.StreamDeckPlugin.Run();
}
```

### ⚡ 2. Create an action
```csharp
using SharpDeck;
using SharpDeck.Events.Received;

[StreamDeckAction("com.geekyeggo.exampleplugin.firstaction")]
public class MyFirstAction : StreamDeckAction
{
// Methods can be overriden to intercept events received from the Stream Deck.
protected override Task OnKeyDown(ActionEventArgs args) => ...;
protected override Task OnKeyUp(ActionEventArgs args) => ...;
}
```

### 📄 3. Create a manifest.json file

> For more information about creating a manifest file, please refer to the [SDK documentation](https://developer.elgato.com/documentation/stream-deck/sdk/manifest/).

### ⚙️ 4. Configure .csproj

```xml

$(APPDATA)\Elgato\StreamDeck\Plugins\com.{{authorName}}.{{pluginName}}.sdPlugin\
false



Always

```

### 🚧 5. Debug profile

> Located at **Properties/launchSettings.json**; this debug profile will automatically launch StreamDeck.exe when debugging starts.
```json
{
"profiles": {
"DebugWin": {
"commandName": "Executable",
"executablePath": "c:\\windows\\system32\\cmd.exe",
"commandLineArgs": "/S /C \"start \"title\" /B \"%ProgramW6432%\\Elgato\\StreamDeck\\StreamDeck exe\" \""
}
}
}
```

## 🏃 Running

When debugging starts (default F5):
1. The plugin will be built and installed.
1. Stream Deck will then launch.
1. You will be prompted to attach your plugin to a process; this allows for debugging.

When your plugin is ready, consider [packaging](https://developer.elgato.com/documentation/stream-deck/sdk/packaging/) and [distributing](https://developer.elgato.com/documentation/stream-deck/sdk/distribution/) it on the Stream Deck store.

## 📃 License

[The MIT License (MIT)](LICENSE.md)
Stream Deck is a trademark or registered trademark of Elgato Systems.