Skip to content

noracu 0.2.6

Choose a tag to compare

@sgInnora sgInnora released this 07 Nov 02:56
· 5 commits to main since this release

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_key with cmd or ctrl on 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 returns not_delivered with keyboard_layout and sends nothing. A plain character, or one with only shift / alt, is still typed through cliclick.
  • mac_paste sends ⌘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_type checks the Mac's keyboard layout before it sends ⌘V (and, with replace, ⌘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 returns keyboard_layout (not_delivered, retry=safe), sends nothing and leaves the clipboard alone. The Spotlight shortcut phone_open uses falls back to clicking the View menu item.
  • phone_type says 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 as delivered_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 at element_index instead of advising force:true or app, which mac_scroll does not take.
  • browser_snapshot marks 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_read and browser_evaluate mark cut text ([truncated: showing N of M chars]).

Changed

  • mac_type without element_index or app returns no_focus and sends nothing when the frontmost app reports no focused element. Before, it sent keystrokes wherever macOS routed them and called that "the focused element". Pass element_index, or app to type into that app anyway. A text view accessibility cannot write (a terminal) still gets keystrokes.
  • mac_type results name the app they typed into.
  • mac_clipboard_read marks Universal Clipboard content (copied on another device) with remote: true and notes that reading it makes macOS fetch it from that device.

Docs

  • README / README.zh-CN: the focus-guard paragraph states when mac_type sends keystrokes; Known limits list the keyboard layouts phone_type needs. SECURITY.md threat 16 notes the Universal Clipboard fetch. docs/usage.md lists no_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_key cmd-a / cmd-c / cmd-v / cmd-z and mac_paste in TextEdit; phone_open and phone_type (with and without replace) 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.