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.5.2/mod.ts";

Constructors

new
StreamDeck(type: DeckType | string, info?: DeckInfo)

Create a new StreamDeck instance

Properties

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

Returns true is device was opened and is connected

readonly
isOpen: boolean

Returns true if device was opened

readonly
keyBlank: Uint8Array
readonly
keyBlankId: symbol
readonly
keyCount: DeckInfo["keyCount"]
readonly
keyFlip: DeckInfo["keyFlip"]
readonly
keyLayout: DeckInfo["keyLayout"]
readonly
keyRotation: DeckInfo["keyRotation"]
readonly
keySize: DeckInfo["keySize"]
readonly
keyStates: boolean[]
readonly
type: string

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

getKeyIndex(x: number, y: number): number

Convert X/Y coordinates to key index

getKeyXY(key: number): [number, number]

Convert key index to X/Y coordinates

iterateKeys(): AsyncGenerator<boolean[]>

Wait for Stream Deck key input and yield key states

listenKeys(): Promise<void>

Wait for Stream Deck key input and trigger events

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

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

Set an individual Stream Deck key image

setKeyData(
key: number,
data?: Uint8Array,
id?: symbol | null,
): void

Set an individual Stream Deck key image

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

Set an individual Stream Deck key image