Something went wrong. Try again.
A Zig library for driving Elgato Stream Deck devices over USB HID.
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869// SPDX-FileCopyrightText: © 2025 Jeffrey C. Ollie <jeff@ocjtech.us>// SPDX-License-Identifier: MIT
//! The Stream Deck Plus XL. Its keys are arranged in a grid nine//! across and four down, each with its own 112x112 display. Like the//! smaller Plus it also has a row of rotary encoders and a touchscreen//! below the keys; those are described by `Encoders` and `Touchscreen`//! rather than here.//!//! `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 ElgatoStreamDeckPlusXL = @This();
const KeyFeature = @import("../Keys.zig").KeyFeature;
pub const vendor: u16 = 0x0fd9;pub const product: u16 = 0x00c6;
/// 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 = 9; /// The number of rows in the key grid. pub const rows: u5 = 4; /// The number of touch keys beyond the grid. This model has none. pub const touch: u5 = 0; /// 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. Every key here displays /// a JPEG image sent with a v2 header. /// /// The displays are mounted a quarter turn round, so an image is /// rotated ninety degrees **counterclockwise** on its way out -- /// `.@"270"`, since the rotation here is named clockwise. Elgato's /// HID documentation says so in as many words, for the keys and for /// the screen alike, which settles a question the two reverse /// engineered implementations could not: both agreed on a quarter /// turn and disagreed about which way, and this library had it /// turning the other way until the documentation was read. /// /// No hardware has confirmed it. The documentation is first-party /// and unambiguous, which is better than this row had before, and /// still not a measurement. pub fn getFeature(key: u8) ?KeyFeature { switch (key) { 0...35 => { return .{ .image = .{ .header_format = .v2, .image_format = .JPEG, .width = 112, .height = 112, .rotation = .@"270", .flip_left_right = false, .flip_top_bottom = false, }, }; }, else => return null, } }};