You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make device indices survive unplug/replug cycles by mapping devices to persistent identifiers instead of using monotonically increasing counters.
Builds on the device identity pipeline from PR #5.
What this includes
Persistent device identification — Use a combination of vendor ID, product ID, device name, and optionally serial number or physical port path to create a stable device fingerprint
Index reservation — When a known device disconnects and reconnects, it gets the same index back
Graceful handling of new devices — Devices not seen before get the next available index
Why
Currently next_device_index increments on every register_device() call, including re-registrations after rediscover_devices(). This means a USB keyboard that gets bumped out and plugged back in gets a different index, breaking any (device N) rules.
Platform considerations
Linux: Can use /dev/input/by-id/ symlinks or evdev device properties (vendor, product, uniq)
Windows: Interception provides device handles with stable HW IDs
macOS: IOHIDManager provides vendor/product ID and transport info
Summary
Make device indices survive unplug/replug cycles by mapping devices to persistent identifiers instead of using monotonically increasing counters.
Builds on the device identity pipeline from PR #5.
What this includes
(defdevice ...)is used (feat: name-based device matching and defdevice config #6), the config order can determine stable indicesWhy
Currently
next_device_indexincrements on everyregister_device()call, including re-registrations afterrediscover_devices(). This means a USB keyboard that gets bumped out and plugged back in gets a different index, breaking any(device N)rules.Platform considerations
/dev/input/by-id/symlinks or evdev device properties (vendor, product, uniq)Dependencies