Something went wrong. Try again.
A Zig library for driving Elgato Stream Deck devices over USB HID.
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566// SPDX-FileCopyrightText: © 2025 Jeffrey C. Ollie <jeff@ocjtech.us>// SPDX-License-Identifier: MIT
//! The Stream Deck Neo. Eight keys with 96x96 displays are arranged in//! a grid four across and two down, and below them sit two touch keys//! whose backlights can be colored but which show no image.//!//! `devices.zig` gathers this module together with the one for every//! other model, so that the control groups can look up the properties//! of whichever device they are attached to.
const ElgatoStreamDeckNeo = @This();
const KeyFeature = @import("../Keys.zig").KeyFeature;
pub const vendor: u16 = 0x0fd9;pub const product: u16 = 0x009a;
/// What this model's keys look like and what they can do. Every device/// module declares this, so the fields and functions below are the same/// from one model to the next even though the values differ.pub const keys = struct { /// The number of columns in the key grid. pub const cols: u5 = 4; /// The number of rows in the key grid. pub const rows: u5 = 2; /// The number of touch keys the model has in addition to its grid. /// They are numbered after the grid keys. pub const touch: u5 = 2; /// The total number of keys, the grid and the touch keys together. pub const count: u8 = @as(u8, cols) * rows + touch;
/// What the given key is capable of, or null if this model has no /// such key. Keys are numbered from zero. Keys 0 through 7 are the /// grid and display a JPEG image sent with a v2 header, flipped /// both ways because the displays are mounted upside down, while /// keys 8 and 9 are touch keys that take a color instead of an /// image. /// /// Confirmed against the hardware: the device sends ten key states /// in a report, and the key labelled 6 arrives as index 6. pub fn getFeature(key: u8) ?KeyFeature { switch (key) { 0...7 => { return .{ .image = .{ .header_format = .v2, .image_format = .JPEG, .width = 96, .height = 96, .rotation = null, .flip_left_right = true, .flip_top_bottom = true, }, }; }, 8...9 => { return .{ .touchled = {}, }; }, else => return null, } }};