Skip to content

feat: name-based device matching and defdevice config #6

@malpern

Description

@malpern

Summary

Add name-based device matching to the (device ...) switch condition and a (defdevice ...) configuration block.

Builds on the device identity pipeline from PR #5.

What this includes

  1. (defdevice ...) config block — Define device aliases mapping friendly names to match criteria (device name substrings, vendor/product IDs, etc.)
  2. (device "Kinesis") string matching — Match devices by name string in switch conditions instead of fragile numeric indices
  3. Device alias resolution — Parser resolves device names at config load time against the registry

Why

Numeric device indices are assigned in registration order and aren't stable across reboots or replug events. Name-based matching is what users actually want for per-device key mappings.

Example

(defdevice kinesis "Kinesis Advantage360")
(defdevice trackpad "Apple Internal Keyboard")

(switch
  ((device kinesis) X break)
  ((device trackpad) Y break))

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