Repository navigation
noracu 0.2.6
noracu 0.2.6
Key chords and pastes now go out on the key that types the character in your keyboard layout, mac_type no longer types into an app it cannot see a focused field in, and several results say more precisely what happened.
Fixed
mac_keywithcmdorctrlon a character key (cmd-c,cmd-v,cmd-z,cmd-shift-v) is posted by the accessibility engine on the key that types that character in the current keyboard layout, with each modifier pressed and released around it. Before, these chords went through cliclick (kd:cmd t:v ku:cmd), the sequence that on macOS 27.2 with the Pinyin input source typed a plain "v" into TextEdit instead of pasting. If no key in the layout types the character, the call returnsnot_deliveredwithkeyboard_layoutand sends nothing. A plain character, or one with onlyshift/alt, is still typed through cliclick.mac_pastesends ⌘V on the key that types V in the current layout. Before, it refused Dvorak layouts, and on other layouts that move V (Workman) it sent ⌘ with the key where V sits on U.S. keyboards.phone_typechecks the Mac's keyboard layout before it sends ⌘V (and, withreplace, ⌘A) to iPhone Mirroring. When the key a chord is sent from types another character — French AZERTY has Q where ⌘A is sent from, Dvorak has K where ⌘V is — it returnskeyboard_layout(not_delivered,retry=safe), sends nothing and leaves the clipboard alone. The Spotlight shortcutphone_openuses falls back to clicking the View menu item.phone_typesays why a paste whose screen change it saw is not confirmed, when the reason is known: a text of fewer than four characters is never confirmed by OCR, and a text OCR saw appear only in the strip at the top of the screen cannot be told from a notification banner. Both return at once asdelivered_unverified, instead of an extra check of up to 15 s that could then report the text "showed up late".mac_scroll's refusals point atelement_indexinstead of advisingforce:trueorapp, whichmac_scrolldoes not take.browser_snapshotmarks a cut ARIA snapshot ([aria snapshot truncated: showing N of M chars …]) and says when it could not list the clickable elements, instead of returning an empty list.browser_readandbrowser_evaluatemark cut text ([truncated: showing N of M chars]).
Changed
mac_typewithoutelement_indexorappreturnsno_focusand sends nothing when the frontmost app reports no focused element. Before, it sent keystrokes wherever macOS routed them and called that "the focused element". Passelement_index, orappto type into that app anyway. A text view accessibility cannot write (a terminal) still gets keystrokes.mac_typeresults name the app they typed into.mac_clipboard_readmarks Universal Clipboard content (copied on another device) withremote: trueand notes that reading it makes macOS fetch it from that device.
Docs
- README / README.zh-CN: the focus-guard paragraph states when
mac_typesends keystrokes; Known limits list the keyboard layoutsphone_typeneeds. SECURITY.md threat 16 notes the Universal Clipboard fetch. docs/usage.md listsno_focus.
Tested
- macOS 27.2, Node 26.10.0, one iPhone on iOS 27 (English) through iPhone Mirroring; U.S. layout with the Pinyin input source.
- With hardware cases: 158/158 in the repository and again from the packed tarball installed in an empty directory. Without hardware (
NORACU_CI=1): 142/142. Engine unit tests: 159/159. iPhone driver smoke tests: 50/50. - On the device:
mac_keycmd-a/cmd-c/cmd-v/cmd-zandmac_pastein TextEdit;phone_openandphone_type(with and withoutreplace) in the iPhone Settings search field.
Known limits
- The keyboard-layout handling was tried on a device only with the U.S. layout and the Pinyin input source. AZERTY, Dvorak and Workman are covered by unit tests that stand in for the layout lookup, not by a device run.
- Otherwise unchanged from 0.2.5.