@logitech-mx-creative-console/core
Version:
An npm module for interfacing with the Logitech MX Creative Console
292 lines • 13.7 kB
JavaScript
import { MXConsoleBase } from './base.js';
import { DeviceModelId, MODEL_NAMES } from '../id.js';
import { freezeDefinitions, generateButtonsGrid } from '../controlsGenerator.js';
import { CallbackHook } from '../services/callback-hook.js';
import { DefaultButtonsLcdService } from '../services/buttonsLcdDisplay/default.js';
import { JpegButtonLcdImagePacker } from '../services/imagePacker/jpeg.js';
import { MXConsoleDefaultImageWriter } from '../services/imageWriter/imageWriter.js';
import { KeypadInputService } from '../services/input/mx-creative-keypad.js';
import { DefaultPropertiesService } from '../services/properties/default.js';
const keypadProperties = {
MODEL: DeviceModelId.MX_CREATIVE_KEYPAD,
PRODUCT_NAME: MODEL_NAMES[DeviceModelId.MX_CREATIVE_KEYPAD],
CONTROLS: freezeDefinitions([
...generateButtonsGrid(3, 3, { width: 118, height: 118 }, { x: 23, y: 6 }, { x: 40, y: 40 }),
{ type: 'button', row: 3, column: 0, index: 9, hidId: 0x01a1, feedbackType: 'none' },
{ type: 'button', row: 3, column: 1, index: 10, hidId: 0x01a2, feedbackType: 'none' },
]),
PANEL_SIZE: { width: 480, height: 480 },
};
export function mxCreativeKeypadFactory(device, options) {
const events = new CallbackHook();
return new MXConsoleBase(device, options, {
deviceProperties: keypadProperties,
events,
properties: new DefaultPropertiesService(device),
buttonsLcd: new DefaultButtonsLcdService(new MXConsoleDefaultImageWriter(), new JpegButtonLcdImagePacker(options.encodeJPEG), device, keypadProperties),
inputService: new KeypadInputService(keypadProperties, events),
});
}
export const mxCreativeKeypadInitWrites = [
// new Uint8Array([
// 0x11, 0xff, 0x00, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x13, 0xff, 0x00, 0x1b, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x00, 0x1b, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x00, 0x0b, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x02, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x02, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x02, 0x1b, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x00, 0x1b, 0x00, 0x00, 0xb1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x00, 0x1b, 0x00, 0x00, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x00, 0x0b, 0x00, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x00, 0x1b, 0x00, 0x00, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x00, 0x0b, 0x16, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x00, 0x1b, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x00, 0x0b, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x00, 0x1b, 0x00, 0x00, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x00, 0x0b, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x00, 0x1b, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x00, 0x0b, 0x1e, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x00, 0x1f, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x00, 0x1b, 0x00, 0x00, 0xd6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x02, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x04, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x02, 0x1f, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x02, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x02, 0x1f, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x13, 0xff, 0x00, 0x2b, 0xe0, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x06, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x13, 0xff, 0x02, 0x7b, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x13, 0xff, 0x02, 0x7b, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x02, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x02, 0x1f, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x13, 0xff, 0x02, 0x3b, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x06, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x02, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x02, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x02, 0x1f, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x02, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x02, 0x1f, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x02, 0x1f, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x13, 0xff, 0x02, 0x5b, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x02, 0x1f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x13, 0xff, 0x02, 0x0b, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x13, 0xff, 0x02, 0x1b, 0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x00, 0x1b, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x00, 0x0b, 0x1b, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x00, 0x1b, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x00, 0x0b, 0x80, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x13, 0xff, 0x02, 0x5b, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x0b, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x0b, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x0b, 0x2b, 0x01, 0xa1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x00, 0x1b, 0x00, 0x00, 0xc9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x00, 0x0b, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
new Uint8Array([
0x11, 0xff, 0x0b, 0x3b, 0x01, 0xa1, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00,
]),
// new Uint8Array([
// 0x11, 0xff, 0x0b, 0x1b, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x0b, 0x2b, 0x01, 0xa2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
new Uint8Array([
0x11, 0xff, 0x0b, 0x3b, 0x01, 0xa2, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00,
]),
// new Uint8Array([
// 0x11, 0xff, 0x02, 0x2b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x02, 0x1b, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x02, 0x1b, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x04, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x13, 0xff, 0x02, 0x7b, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x11, 0xff, 0x04, 0x1b, 0x0b, 0xb8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00,
// ]),
// new Uint8Array([
// 0x13, 0xff, 0x02, 0x5b, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// ]),
];
//# sourceMappingURL=mx-creative-keypad.js.map