Skip to content

feat: per-device layer stacks #7

Description

@malpern

Summary

Allow each physical device to maintain its own independent layer stack, so layer changes on one device don't affect another.

Builds on the device identity pipeline from PR #5.

What this includes

  1. Per-device layer state in Layout — Instead of one global default_layer and layer stack, maintain separate stacks keyed by device index
  2. Layer action scoping — Layer-switch actions apply only to the originating device's stack
  3. Fallback behavior — Devices without explicit layer config fall back to the global stack (backwards compatible)

Why

The main use case for per-device mappings is having fundamentally different layouts per keyboard (e.g., a split ergo board for typing and a macropad for shortcuts). Without per-device layer stacks, pressing a layer key on one device shifts layers for all devices.

Complexity note

This is a significant architectural change to keyberon's Layout struct. The current design assumes a single layer stack throughout. This will need careful design to avoid breaking existing behavior.

Dependencies

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions