Giter Site home page Giter Site logo

streamdecksharp's Introduction

StreamDeckSharp

StreamDeckSharp is a simple (unofficial) .NET interface for the Stream Deck (https://www.elgato.com/de/gaming/stream-deck). This project is not related to Elgato Systems GmbH in any way.

Quickstart (TL;DR)

At the moment only Windows is supported (tested with 10, should also work with 7 and 8)

  1. Add StreamDeckSharp reference (via nuget or download latest release)
  2. Add a using directive for StreamDeckSharp: using StreamDeckSharp;
I want to... Code (C#)
create a device reference var deck = StreamDeck.FromHID();
set the brightness deck.SetBrightness(50);
create bitmap for key var bitmap = StreamDeckKeyBitmap.FromFile("icon.png")
set key image deck.SetKeyBitmap(keyId,bitmap)
clear key image deck.ClearKey(keyId)
process key events deck.KeyPressed += 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 in the repo.
Here is a short example called "Austria". Copy the code and start hacking ;-)

using StreamDeckSharp;

namespace StreamDeckSharp.Examples.Austria
{
    class Program
    {
        static void Main(string[] args)
        {
            //Create some color we use later to draw the flag of austria
            var red = StreamDeckKeyBitmap.FromRGBColor(237, 41, 57);
            var white = StreamDeckKeyBitmap.FromRGBColor(255, 255, 255);
            var rowColors = new StreamDeckKeyBitmap[] { red, white, red };

            //Open the Stream Deck device
            using (var deck = StreamDeck.FromHID())
            {
                deck.SetBrightness(100);

                //Send the bitmap informaton to the device
                for (int i = 0; i < deck.NumberOfKeys; i++)
                    deck.SetKeyBitmap(i, rowColors[i / 5]);
            }
        }
    }
}

Here is what the "Rainbow" example looks like after pressing some keys

Rainbow example photo

streamdecksharp's People

Contributors

dawgdemi avatar wischi-chr avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.