mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-06-30 04:14:47 +03:00
docs(macos): clarify repeat-task cleanup releases the key
Address @feschber review feedback on PR #441. The repeat-task cleanup already releases the key with the correct CGKeyCode via the existing key_event call at the end of the closure — this commit just expands the surrounding comment to make that explicit and to document why update_modifiers is intentionally NOT called from this path (Mac CGKeyCode vs Linux evdev scancode collision). No behavioral change. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
committed by
Ferdinand Schober
parent
c32d695cd9
commit
4b93be3228
@@ -106,14 +106,19 @@ impl MacOSEmulation {
|
||||
}
|
||||
}
|
||||
}
|
||||
// release key when cancelled.
|
||||
// Always release the key with the correct CGKeyCode, regardless of
|
||||
// whether the repeat loop ran. This matches @feschber's review
|
||||
// request: "still release the key repeat task but with the correct
|
||||
// code."
|
||||
//
|
||||
// Do NOT call update_modifiers here: `key` is a Mac CGKeyCode but
|
||||
// update_modifiers expects a Linux evdev scancode, and the two
|
||||
// codespaces collide (e.g. Mac LeftShift=56 == Linux KeyLeftAlt=56,
|
||||
// Mac Down=125 == Linux KeyLeftMeta=125), corrupting modifier
|
||||
// state for chords like Shift+Option+X or Cmd+Down. Modifier state
|
||||
// is owned by the main consume() loop, which calls update_modifiers
|
||||
// with the correct Linux scancode on the real release event.
|
||||
// is owned by the main consume() loop, which already calls
|
||||
// update_modifiers with the correct Linux scancode on the real key
|
||||
// release event from the client.
|
||||
key_event(event_source.clone(), key, 0, modifiers.get());
|
||||
});
|
||||
self.repeat_task = Some(repeat_task);
|
||||
|
||||
Reference in New Issue
Block a user