GithubHelp home page GithubHelp logo

tyrende / streamdeck-client-csharp Goto Github PK

View Code? Open in Web Editor NEW
86.0 11.0 16.0 115 KB

This is a C# wrapper library used to write Elgato Stream Deck plugins.

License: MIT License

C# 56.94% HTML 1.10% JavaScript 4.47% CSS 37.49%

streamdeck-client-csharp's Introduction

NuGet

streamdeck-client-csharp

A C# client library for the Elgato Stream Deck device.

What is this?

Elgato just released their Official Stream Deck SDK, but it only supported Javascript, C++, and Objective-C. I was frustrated as I prefer C# as my go-to language. So, I wrote this wrapper to ease writing plugins.

What's New

Added support for new Stream Deck+ SDK

Requirements

This library uses the native WebSocket support found in Windows 8 & higher. This means that any application that uses this library must be running Windows 8 or higher.

Current functionality

The library should support all features documented by the SDK:

  • Connection and Disconnection
  • Sending messages
  • Receiving events

Feature roadmap

At this point, we should only need to monitor the Official SDK for new features and implement them.

How do I get started using it?

Download the NuGet package by searching for "streamdeck-client-csharp" or downloading it manually from https://www.nuget.org/packages/streamdeck-client-csharp. If you clone the repository, you will see the TestPlugin C# project. When this is compiled it creates a folder in the output directory com.tyren.testplugin.sdPlugin. If you copy this into your Stream Deck's Plugin Folder, and launch Stream Deck, you should see the C# Test Plugin category show up with some test actions inside.

I found a bug, who do I contact?

Just head over to the https://github.com/TyrenDe/streamdeck-client-csharp/issues page and create a new issue.

License

MIT License

Copyright (c) 2019 Shane DeSeranno

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

streamdeck-client-csharp's People

Contributors

barraider avatar tyrende avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

streamdeck-client-csharp's Issues

.Net Core (6.0/7.0) support

Are there any plans to update this to support the newer versions of .Net, not just the older Framework versions?

Looking to try and use this lib to allow AutoHotkey interop

Hi, I wrote a library for the SD called AutoHotStreamDeck ("AHSD")
The goal is to allow an AutoHotkey script to handle button events, and also allow the AHK script to change button graphics.
This lib uses pure HID to communicate with the SD - an AHK script loads the AHSD C# DLL, and can make calls to the DLL to change button graphics, and pass a function pointer to the C# DLL which gets fired when the specified button changes state.
The big fly in the ointment here is that the SD is completely unaware that AHSD is handling one of the buttons - ie the user must make sure that button is left blank in the SD software
The main problem I see is a fundamental difference in architecture - with AHSD as it stands, one AHK script can handle multiple SD buttons, and I would not really want to lose that functionality.
Here is an example: https://cdn.discordapp.com/attachments/330423308103319562/475730772586659870/2018-08-05_19_21_53.gif
TLDR, I would like to allow one AHK script to be able to control imagery and react to button events of more than one button, whilst allowing other buttons on the same page to be controlled by the SD software
Any advice gratefully received.

How to properly disconnect and reconnect to the Stream Deck App?

I am using a plugin to connect to an external application. The external application uses the streamdeck-client-sharp library to connect to the Stream Deck App. That application might be started, stopped and restarted. The plugin sends the connection information received by the Stream Deck App to the external application.
I want to be able to properly disconnect from the Stream Deck App, and to be able to reconnect again.

When I use the StreamDeckConnection.Close(), where the m_CancelSource.Cancel() is called, and try to connect again using a NEW StreamDeckConnection and StreamDeckConnection.Run(), I see this in the Stream Deck logs:

ESDCustomPluginCommunication::onMessageReceived(): Plugin 703EA06C6B1F93B5DC9A996984D6AEFF is already connected

And of course, the new connection doesn't work as expected.
Most likely, this is caused by this line in the RunAsync() method:
await SendAsync(new RegisterEventMessage(m_RegisterEvent, this.UUID));
It sends the RegisterEventMessage which I think triggers the error in the Stream Deck App side.
Would it be enough to simply reconnect the websocket connect on the proper port? Without 'registering'?

What is the proper way to disconnect the StreamDeckConnection from the Stream Deck App to be able to reconnect?

Thanks!

Needs updating...

This is project still maintained?

It's been a while since it was updated. At least update the references and, for example, the DeviceType enum. As per documentation: Possible values are kESDSDKDeviceType_StreamDeck (0), kESDSDKDeviceType_StreamDeckMini (1), kESDSDKDeviceType_StreamDeckXL (2), kESDSDKDeviceType_StreamDeckMobile (3), kESDSDKDeviceType_CorsairGKeys (4), kESDSDKDeviceType_StreamDeckPedal (5), kESDSDKDeviceType_CorsairVoyager (6), and kESDSDKDeviceType_StreamDeckPlus (7).

Now, it only shows the first 2.

There are some other relatively small changes between the current version (https://developer.elgato.com/documentation/stream-deck/sdk/overview/) and what is in the library.

SD+

Any plans to update this for the SD+?

direct acces in application

is it not possible ton have a dll used in client application (location in application directory)
with class (Idisposable) for each stream deck

  • when created -> create connexion (or loop until)
  • register event to receive notification when key up and key down
  • send or load image
  • and when disposed -> disconnect

Context Value of button

Hi
Is there a way to get the context value of all the buttons at the starting of the application ?
so that I can store it in dictionary using its UUID and context value

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.