feat(desktop): screen text capture (OCR) overlay with selectable text
A rebindable screen-ocr action (default Ctrl+Alt+O) freezes the monitor under the cursor and covers it with a focusable overlay. Text is selected by flow drag, rectangle drag, double/triple click, Shift+click or Ctrl+A, then copied, saved as PNG or searchable PDF, translated, summarized, read aloud, opened as a link or searched. - Selection, text assembly and the PDF document are pure functions in @d3ro/core/screen-ocr, shared by the main process and the overlay. - Recognition uses Windows.Media.Ocr through powershell.exe -EncodedCommand with 2x upscaling; the capture reaches disk only as a temp PNG that is removed right after recognition. - Capture uses GDI BitBlt for the target monitor (39 ms) because desktopCapturer captured all three monitors and took 2.9 s when DXGI duplication timed out. - The accelerator is reserved only where the feature is available, so macOS does not swallow the key for a feature it cannot run (fails closed with a message). Map: CAP-17 [~], GAP-OCR-01 (live hotkey journey not yet driven in the running app), GAP-OCR-02 (macOS engine, mixed-language accuracy).
This commit is contained in:
parent
6791e29f27
commit
03cd8bf890
41 changed files with 4561 additions and 17 deletions
|
|
@ -70,6 +70,18 @@ describe('acceleratorsToReserve', () => {
|
|||
).toEqual(['Control+Shift+V', 'Control+Shift+C'])
|
||||
})
|
||||
|
||||
it('화면OCR단축키예약_쓸수없는환경_키만삼키지않게예약하지않고쓸수있을때만예약한다', () => {
|
||||
const reserved = (screenOcrAvailable: boolean | undefined): string[] =>
|
||||
acceleratorsToReserve(defaultReservable(), {
|
||||
platform: 'darwin',
|
||||
flags: { suggestionEnabled: false, screenOcrAvailable }
|
||||
})
|
||||
expect(reserved(undefined)).not.toContain('Control+Alt+O')
|
||||
expect(reserved(false)).not.toContain('Control+Alt+O')
|
||||
expect(reserved(true)).toContain('Control+Alt+O')
|
||||
expect(isKeyBindingActionFeatureEnabled('screen-ocr', { suggestionEnabled: true })).toBe(false)
|
||||
})
|
||||
|
||||
it('macOS 에서 제안 기능이 켜져 있으면 suggestion-* 바인딩도 예약한다', () => {
|
||||
expect(
|
||||
acceleratorsToReserve(defaultReservable(), { platform: 'darwin', flags: { suggestionEnabled: true } })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue