Skip to main content
Module

x/deno_streamdeck/mod.ts>StreamDeck

🦕 Deno library for Stream Deck
Go to Latest
class StreamDeck
extends EventTarget
import { StreamDeck } from "https://deno.land/x/deno_streamdeck@v0.2.0/mod.ts";

Constructors

new
StreamDeck(info: DeckInfo)

Create a new StreamDeck instance

Properties

readonly
hid: bigint
readonly
hidInfo: HIDInfo | null
readonly
info: DeckInfo
readonly
isConnected: boolean

True is device was opened and is connected

readonly
isOpen: boolean

True if device was opened

readonly
keyBlank: Uint8Array
readonly
keyCount: DeckInfo["keyCount"]
readonly
keyFlip: DeckInfo["keyFlip"]
readonly
keyLayout: DeckInfo["keyLayout"]
readonly
keyRotation: DeckInfo["keyRotation"]
readonly
keySize: DeckInfo["keySize"]
readonly
keyStates: boolean[]

Methods

brightness(percent: number): void

Set Stream Deck display brightness

close(): boolean

Close the Stream Deck device and exit HIDAPI (close event is dispatched on disconnection)

flipKeyData(data: Uint8Array): Uint8Array

Flip raw image data to match device settings

listenKeys(): AsyncGenerator<boolean[]>

Wait for Stream Deck key input and yield key states

open(): void

Initialize HIDAPI and open the Stream Deck device (open event is dispatched on connection)

readKeys(): Promise<boolean>

Wait for Stream Deck key input and update key states (keystates event is dispatched on input)

reset(): void

Reset the Stream Deck

setKeyData(key: number, data: Uint8Array): void

Set an individual Stream Deck key image

setKeyJpeg(key: number, path: string): void

Set an individual Stream Deck key image