StreamDeckSharp
StreamDeckSharp copied to clipboard
A simple .NET wrapper for Stream Deck

StreamDeckSharp is a simple (unofficial) .NET interface for the Elgato Stream Deck
Recent Changes
Changes in v4.0.0-preview
A preview version (v4.0.0-preview) is currently available on nuget. At the moment there isn't a migration guide, but Jon Skeet has a project that show a the changes he had to make: https://github.com/OpenMacroBoard/StreamDeckSharp/issues/45#issuecomment-1079933751 Alternativly you can also take a look at the changes of the example projects: Changes example projects
Quickstart (TL;DR)
At the moment only Windows is "officially" supported.
Need help with Linux or macOS? → Wiki: Supported Platforms
- Add StreamDeckSharp reference (via nuget or download latest release)
- Add a using directive for StreamDeckSharp:
using StreamDeckSharp;
I want to... | Code (C#) |
---|---|
create a device reference | var deck = StreamDeck.OpenDevice(); |
set the brightness | deck.SetBrightness(50); |
create bitmap for key | var bitmap = KeyBitmap.Create.FromFile("icon.png") |
set key image | deck.SetKeyBitmap(keyId, bitmap) |
clear key image | deck.ClearKey(keyId) |
process key events | deck.KeyStateChanged += KeyHandler; |
Make sure to dispose the device reference correctly (use using
whenever possible)
Examples
If you want to see some examples take a look at the example projects.
Here is a short example called "Austria". Copy the code and start hacking :wink:
using System;
using OpenMacroBoard.SDK;
using StreamDeckSharp;
namespace StreamDeckSharp.Examples.Austria
{
class Program
{
static void Main(string[] args)
{
//This example is designed for the 5x3 (original) Stream Deck.
//Create some color we use later to draw the flag of austria
var red = KeyBitmap.Create.FromRgb(237, 41, 57);
var white = KeyBitmap.Create.FromRgb(255, 255, 255);
var rowColors = new KeyBitmap[] { red, white, red };
//Open the Stream Deck device
using (var deck = StreamDeck.OpenDevice())
{
deck.SetBrightness(100);
//Send the bitmap informaton to the device
for (int i = 0; i < deck.Keys.Count; i++)
deck.SetKeyBitmap(i, rowColors[i / 5]);
Console.ReadKey();
}
}
}
}
Here is what the "Rainbow" example looks like after pressing some keys
Play games on a StreamDeck
For example minesweeper (take a look at the example projects if you are interested in that)

You can even play videos on a StreamDeck
Here is a short demo, playing a video on a stream deck device.
*The glitches you can see are already fixed.
More about that in the Wiki: Play video on StreamDeck