logitech-craft-plugin
A JavaScript (and TypeScript) API for creating a Logitech Options Craft keyboard plugin.
Make sure to reference the official Craft SDK documentation as well.
API and Example
; // Create the plugin instance by passing your unique plugin GUID; // Listen to connection attempt eventscraftKeyboard.on'connect:begin',; // Listen to connection success eventscraftKeyboard.on'connect:done',; // Listen to connection failure eventscraftKeyboard.on'connect:failed',; // Listen to ANY crown turn eventcraftKeyboard.on'crown:turn',; // Listen to specificly left crown turn eventscraftKeyboard.on'crown:turn:positive',; // Listen to specificly right crown turn eventscraftKeyboard.on'crown:turn:negative',; // Listen to ANY crown touch eventcraftKeyboard.on'crown:touch',; // Listen to specificly crown touched eventscraftKeyboard.on'crown:touch:touched',; // Listen to specificly turn released eventscraftKeyboard.on'crown:touch:released',; // Change the active tool (e.g. user switched to a different tool in your app)craftKeyboard.changeTooltoolIdString; // Close the connectioncraftKeyboard.close;
More Extensive Example
This code is used in the Logitech Craft VS Code extension.