Skip to content

Resolve Paste using command-modified keyboard layouts - #19

Open
MiMoHo wants to merge 2 commits into
haad:masterfrom
MiMoHo:use-physical-v-for-paste
Open

MiMoHo wants to merge 2 commits into
haad:masterfrom
MiMoHo:use-physical-v-for-paste

Conversation

@MiMoHo

@MiMoHo MiMoHo commented Aug 31, 2026

Copy link
Copy Markdown

Summary

Resolve Paste using the current layout's Command-modified key map instead of assuming the physical ANSI-V key always means Command-V.

The previous revision avoided an unresolved-key fallback to Command-A, but introduced a different regression: under standard Dvorak, ANSI-V produces Command-K. Dvorak–QWERTY Command intentionally has different shortcut behavior.

  • Resolve a single v or V through native UCKeyTranslate with the Command modifier and current hardware keyboard type; do not cache layout state.
  • Use the system's ASCII-capable layout only when the primary layout lacks Unicode data. Return no key for absent data, data shorter than the layout header, or an unsuccessful translation; never guess ANSI-V or keycode zero.
  • Allocate both key events before posting either. Missing keycodes and partial allocation failures post nothing and release allocated objects.

Related: #7 handles paste-target transactions and #15 handles permission requests. This scoped revision does not replace either flow.

Verification

Eight native regression tests pass. They execute the production resolver and extracted key-posting methods against installed US, Dvorak, Dvorak–QWERTY Command and Russian layout data, with additional fallback, translation-error, no-op and allocation-failure cases. RED/GREEN evidence is retained locally.

Consent, current-layout selection and event-posting boundaries are intercepted. A symbol check verifies that the fixture cannot call the actual input or permission functions. No real key events, layout changes, clipboard access or TCC changes are used.

Limits

Native layout translation and intercepted event traces are not a live paste into a target application. No new signed installation, full Xcode project build, minimum-OS verification or CI success is claimed.

AI assistance

Implemented and independently reviewed with Hermes Agent using gpt-6-astra. The session does not expose its reasoning-effort setting; no value is inferred.

Updates haad#19.

AI assistance: Hermes Agent, gpt-6-astra.
Reasoning effort: not exposed by this session.
@MiMoHo MiMoHo changed the title Use the physical V key for paste on every keyboard layout Resolve Paste using command-modified keyboard layouts Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant