Conversation
… no matches (jtroo#1986) ## Summary - When `macos-dev-names-include` or `macos-dev-names-exclude` is configured but no connected devices match, kanata was falling back to `register_device("")` which intercepts **all** devices - This caused kanata to grab the wrong keyboard (e.g., the internal MacBook keyboard when an external keyboard was specified but not connected) - Now kanata only falls back to the catch-all registration when no device filter is configured at all — when a filter is present but nothing matches, kanata exits with an error Fixes jtroo#1479 ## Test plan - [x] Configured `macos-dev-names-include` with a nonexistent device name — kanata now errors out instead of grabbing all devices - [x] Configured `macos-dev-names-include` with a real connected device — kanata correctly grabs only that device and remapping works - [x] No include/exclude list — default behavior unchanged (grabs all devices) ## Possible follow-up Linux has `linux-continue-if-no-devs-found` which lets kanata wait for devices instead of exiting. A cross-platform `continue-if-no-devs-found` option could be added to support the multi-instance use case where kanata should stay running and pick up the device when it connects. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…to 0.3.0 (jtroo#1987) ## Describe the changes Bump `karabiner-driverkit` to 0.3.0 and improve `--list` output for BLE device users. The driverkit update adds a fallback to the IORegistry `"Product"` property when `kIOHIDProductKey` is empty, fixing BLE HID keyboards (e.g. ZMK-based boards) showing blank `product_key` in `kanata --list`. The `--list` output changes: - Only show the "use hash values" hint when there are actually devices with empty names - Warn when Karabiner virtual devices are detected that hash-based matching may not be stable (Karabiner re-exposes all devices with a shared hash) Fixes jtroo#1944 --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
A release-time variant of tap-hold-opposite-hand. Same signature, options, and defhands dependency. The only difference is that it waits for the interrupting key's press+release before committing, which avoids misfires on fast same-hand rolls where keystrokes briefly overlap. This closes the main gap between kanata HRM behavior and ZMK's "timeless home-row mods" recipe. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Code ReviewOverall this is a well-structured addition that fills a real gap for ZMK-style timeless home-row mods. The implementation is correct and the tests demonstrate the key behavioral difference from Bugs / CorrectnessStale development comment left in test (
// Note: 's' is same-hand but not in defsrc, use a key in defsrc.
// Actually, 'a' is the tap-hold key itself. Let me use a different config.These look like in-editor scratch notes. They should be removed — a test comment should describe intent, not thinking-out-loud during authorship. Code Quality / Duplication
A shared helper accepting a function-pointer/flag would eliminate the duplication: fn parse_tap_hold_opposite_hand_inner(
ac_params: &[SExpr],
s: &ParserState,
wait_for_release: bool,
) -> Result<&'static KanataAction> { ... }Similarly, Performance (hot path)O(n²) release scan ( if !queued.clone().copied().any(|q| q.event() == release) {
continue;
}For each press event in the queue, we clone and scan the remainder of the queue for a matching release — O(n) per press, O(n²) total. The existing Unrelated changes mixed inThe PR includes three changes that appear unrelated to
None of these are blockers, but mixing unrelated fixes makes Minor
Test coverageThe 5 simulation tests cover the main cases well. Missing coverage:
These aren't blocking, but they'd round out the test suite and prevent regressions if the option parsing is ever refactored. |
- Remove stale dev comment from test - Add tests for (same-hand hold), (same-hand ignore), and (neutral-keys) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Code Review:
|
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Code Review:
|
Summary
A release-time variant of
tap-hold-opposite-hand. Same signature, options, anddefhandsdependency. The only difference is that it waits for the interrupting key's press+release before committing, which avoids misfires on fast same-hand rolls where keystrokes briefly overlap.This closes the main gap between kanata HRM behavior and ZMK's "timeless home-row mods" recipe.
Checklist
🤖 Generated with Claude Code