GitXplorerGitXplorer
S

Codedeck

public
13 stars
6 forks
6 issues

Commits

List of commits on branch master.
Verified
cd34f634adc519ba69422e520588404de992bd65

Merge pull request #16 from Sherlouk/ci

SSherlouk committed a year ago
Unverified
b003c39f60257fbe61dbb59b923a272ec27a2a5f

Update build.yml

SSherlouk committed a year ago
Unverified
8e900384cf7626fd779afc8b19e4e7a220b82c79

Add CI Job

SSherlouk committed a year ago
Verified
f4d97c01ea4347c52cbce05dd687f365fdef461e

Merge pull request #15 from Sherlouk/2024

SSherlouk committed a year ago
Unverified
a021dac0c249c4a3328560df5b763259dfe3cf3b

Added setImage from Grant Butler

SSherlouk committed a year ago
Unverified
82a843e190bc39d515a7359fbcab4969e69d297e

Remove Cocoa Dependency from JPEG Converter

SSherlouk committed a year ago

README

The README file for this repository.

Codedeck Coverage Status

A Swift library for interfacing with an Elgato StreamDeck.

Features

  • Multiplatform Support (See below)
  • Hotswapping and Multiple Connected Devices Support
  • Set Device Brightness
  • Fill Key with Solid RGB Colors
  • More Soon!

Multiplatform Support

Swift is compatible with most modern systems and this project makes an effort to keep dependencies light and not coupled to things like Cocoa/UIKit etc.

There are some extensions which, if Cocoa is available, adds extra functionality but this does not limit what you're able to do rather just makes things simpler!

Usage

Creating a StreamDeck

A StreamDeck currently requires a HIDDevice to be created. This is a thin wrapper around the IOHIDDevice available in Apple's IOKit.

This library provides a device monitoring solution which informs of you when certain devices are connected/disconnected from the system. This allows you to hotswap StreamDeck devices as well as connect to multiple at once!

// 1. Create a device monitor and store a reference to it in your application
var monitor: HIDDeviceMonitor = {
    return HIDDeviceMonitor(streamDeckProducts: [ .streamDeck ])
}()

// 2. Create a delegate class within your application
extension SomeClass: HIDDeviceMonitorDelegate {

    func HIDDeviceAdded(device: HIDDevice) {
        // ...
    }

    func HIDDeviceRemoved(device: HIDDevice) {
        // ...
    }

    func HIDDeviceError(error: Error) {
        // ...
    }

}

// 3. Start monitoring for existing and new devices
monitor.startMonitoring(delegate: ...)

// 4. When you have access to a "HIDDevice" initialize a "StreamDeck" with it
let streamDeck = try StreamDeck(device: HIDDevice)

Credit

Credit to Arti3DPlayer/USBDeviceSwift for the foundations of the HID detection which I expanded upon

Credit to Lange/node-elgato-stream-deck for their work and making the necessary payloads available