Skip to content

Merge example plugins - #43

Merged
john-lay merged 5 commits into
masterfrom
merge-example-plugins
Oct 9, 2026
Merged

john-lay merged 5 commits into
masterfrom
merge-example-plugins

Conversation

@john-lay

@john-lay john-lay commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds two new example plugins, HapticsPlugin and SnakePlugin, alongside the existing DemoPlugin. It also rewrites the root README so it works as a proper catalog of the examples.

What's changed

New example plugins

  • HapticsPlugin/ — triggers haptic feedback with the PluginEvents API, covering several waveform families.
  • SnakePlugin/ — a playable Snake game built on PluginDynamicFolder, rendered across the 3×3 button grid.

Root README.md rewritten

  • New Plugins section with a per-plugin breakdown: description, actions and key patterns.
  • New DemoPlugin entry, listed first as the baseline "start here" plugin.
  • The existing Documentation and Developer Discord links are kept, under a new Resources section.
  • New Building section with a per-plugin table of project directories and target frameworks, plus packaging steps using logiplugintool.
  • New Requirements section: Logi Options+, the .NET SDK matching the plugin you're building, and a compatible device.

Unchanged

  • DemoPlugin/ is untouched.

Resulting layout

actions-sdk/
├── README.md
├── DemoPlugin/      (DemoPlugin/DemoPlugin/, .NET 8)
├── HapticsPlugin/   (src/, .NET 10)
└── SnakePlugin/     (src/, .NET 10)

Generated with logiplugintool generate Haptics as a starting point for
a haptics event-mapping example plugin.
- Enable HasHapticMapping in LoupedeckPackage.yaml
- Add DefaultEventSource.yaml and events/extra/eventMapping.yaml
  mapping four events to one waveform per family: buttonPress
  (State Change), milestoneReached (Special), dialTick
  (Collision), counterReset (Alert)
- Register and raise these events from CounterCommand and
  CounterAdjustment per the SDK's Haptics Getting Started guide
- Bump TargetFramework to net10.0 and set PluginApi's Private to
  false to match LogiPluginService v6.4 and keep the package slim,
  per known fixes already applied in screen-display

Verified on a connected MX Master 4: Press Counter feels
sharp_collision on every press and jingle on every 10th; Tick
Counter feels subtle_collision per detent and completed on reset.
Adds a fully playable Snake game plugin that showcases how to use
PluginDynamicFolder to take over the 3x3 button grid as a single
interactive canvas.

Key patterns demonstrated:
- PluginDynamicFolder with 9 named slots ("00".."22")
- Atomic tile rendering: all 9 BitmapImages rendered in a single lock
  so every tile sees the same game snapshot (avoids visual tearing)
- Background game loop via Task.Run with CancellationToken
- CommandImageChanged() called with raw slot key (not CreateCommandName)
  from background threads — critical SDK gotcha
- GetNavigationArea → EncoderArea to free all 9 button slots
- Close() for programmatic folder exit
- Embedded PNG resource loaded via PluginResources
Brings in HapticsPlugin and SnakePlugin with their history. The root
README is now based on the example plugins README, with an added
DemoPlugin entry and the existing docs and Discord links kept under
Resources.
@john-lay
john-lay requested a review from akihirvonen October 9, 2026 09:19
@john-lay john-lay self-assigned this Oct 9, 2026
@akihirvonen
akihirvonen requested a balanced review from Copilot October 9, 2026 13:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Package compatibility, image sizing, game collision logic, and packaging documentation contain functional defects.

5 open findings
What changed in this PR

Adds Haptics and Snake example plugins and turns the root README into an example catalog with build guidance.

Changes:

  • Adds haptic command and adjustment examples.
  • Adds a 3×3 playable Snake dynamic folder.
  • Documents all examples, requirements, and packaging.
File Description
README.md Catalog and build instructions
HapticsPlugin/​.gitignore Build exclusions
HapticsPlugin/​.vscode/​launch.json Debug configuration
HapticsPlugin/​.vscode/​tasks.json Build and packaging tasks
HapticsPlugin/​HapticsPlugin.sln Haptics solution
HapticsPlugin/​src/​.editorconfig C# formatting rules
HapticsPlugin/​src/​Directory.Build.props Build paths and language version
HapticsPlugin/​src/​HapticsApplication.cs Application adapter
HapticsPlugin/​src/​HapticsPlugin.cs Plugin entry point
HapticsPlugin/​src/​HapticsPlugin.csproj Project and deployment targets
HapticsPlugin/​src/​Actions/​CounterAdjustment.cs Dial counter and haptics
HapticsPlugin/​src/​Actions/​CounterCommand.cs Press counter and haptics
HapticsPlugin/​src/​Helpers/​PluginLog.cs Logging helper
HapticsPlugin/​src/​Helpers/​PluginResources.cs Resource helper
HapticsPlugin/​src/​package/​events/​DefaultEventSource.yaml Haptic event declarations
HapticsPlugin/​src/​package/​events/​extra/​eventMapping.yaml Waveform mappings
HapticsPlugin/​src/​package/​metadata/​Icon256x256.png Package icon
HapticsPlugin/​src/​package/​metadata/​LoupedeckPackage.yaml Package metadata
SnakePlugin/​.gitignore Build exclusions
SnakePlugin/​.vscode/​launch.json Debug configuration
SnakePlugin/​.vscode/​tasks.json Build and packaging tasks
SnakePlugin/​SnakePlugin.sln Snake solution
SnakePlugin/​src/​.editorconfig C# formatting rules
SnakePlugin/​src/​Directory.Build.props Build paths and language version
SnakePlugin/​src/​SnakeApplication.cs Application adapter
SnakePlugin/​src/​SnakePlugin.cs Plugin entry point
SnakePlugin/​src/​SnakePlugin.csproj Project, resources, and deployment
SnakePlugin/​src/​Actions/​SnakeFolder.cs Folder layout, input, and rendering
SnakePlugin/​src/​Game/​SnakeGame.cs Core game state
SnakePlugin/​src/​Game/​SnakeGameController.cs Game loop and notifications
SnakePlugin/​src/​Game/​SnakeRenderer.cs Tile rendering
SnakePlugin/​src/​Helpers/​PluginLog.cs Logging helper
SnakePlugin/​src/​Helpers/​PluginResources.cs Resource helper
SnakePlugin/​src/​Resources/​snake-icon.png Snake action icon
SnakePlugin/​src/​package/​metadata/​LoupedeckPackage.yaml Package metadata

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread HapticsPlugin/src/package/metadata/LoupedeckPackage.yaml
Comment thread SnakePlugin/src/Game/SnakeGame.cs
Comment thread SnakePlugin/src/Actions/SnakeFolder.cs
Comment thread SnakePlugin/src/package/metadata/LoupedeckPackage.yaml
Comment thread README.md
@john-lay
john-lay merged commit d8bcb34 into master Oct 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants