# 【GdOcrTool】即指即译，OCR取词工具

**URL:** <https://forum.freemdict.com/t/topic/7166>\
**Category:** 软件经验交流展望\
**Tags:** ocr, goldendict\
**Created:** [2021 年7 月 7 日 12:31 UTC](https://forum.freemdict.com/t/topic/7166 "2021-07-07T12:31:54Z")\
**Posts on this page:** 1\
**Showing post:** 151

<div class="post-metadata">

**Author:** ![medp7060](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/m/8edcca/32.png) [@medp7060](https://forum.freemdict.com/u/medp7060)\
**Post date:** [2021 年11 月 20 日 05:43 UTC](https://forum.freemdict.com/t/topic/7166/151 "2021-11-20T05:43:37Z")

</div>

@Vim so it is doable. ~~However, it is still beyond me. I just wait and hope @Johnny_Van will incorporate the codes in his OCR script.~~

~~我试着改了一下，把“ [GdOcrTool\_Cross.ahk](https://pastebin.com/tiFWEGMT)”放在 **GoldenDict.exe所在目录** ，启动即可。~~

Updated 2021/11/25: 我把十字鼠标加入了 @Johnny_Van 最新的版本：

这里下载：[GdOcrTool\_Cross 2021-11-25.zip](https://forum.freemdict.com/uploads/short-url/eTXxpTEe3Dt5RqfiCM14cjrzxBL.zip) (3.2 KB)

按 ctrl和’ 键激活框选后，mouse pointer变成“+” （除了在Adobe Acrobat里)， 按Esc(或者ctrl和q) 恢复原来的mouse pointer。

Updated 2021/11/21: 不能在Adobe Acrobat里改变mouse pointer，是因为Acrobat (reader) does not use the Windows System settings for their cursors. Therefore, you cannot change the cursors in Acrobat (reader) - neither color nor the icon can be changed. 好在，如果是图片pdf，Adobe Acrobat的mouse pointer会自动变成"+"形。

班门弄斧，很不成熟， 盼望 @Johnny_Van 出手定证。

**具体改动如下** ：

把下面的

```auto
^`:: ; Start box capture by pressing ctrl + `

```

换成：

```auto
^`::SetSystemCursor("IDC_CROSS")+BoxCapture() ; Start box capture by pressing ctrl + `
^q::RestoreCursors()

SetSystemCursor( Cursor = "", cx = 0, cy = 0 )
{
	BlankCursor := 0, SystemCursor := 0, FileCursor := 0 ; init
	
	SystemCursors = 32512IDC_ARROW,32513IDC_IBEAM,32514IDC_WAIT,32515IDC_CROSS
	,32516IDC_UPARROW,32640IDC_SIZE,32641IDC_ICON,32642IDC_SIZENWSE
	,32643IDC_SIZENESW,32644IDC_SIZEWE,32645IDC_SIZENS,32646IDC_SIZEALL
	,32648IDC_NO,32649IDC_HAND,32650IDC_APPSTARTING,32651IDC_HELP
	... (详见附件 “GdOcrTool_Cross 2021-11-25.ahk”)

```

这里再改一下：增加一行 RestoreCursors()

```auto
LButton Up::
LeftButtonUp() {
    Send, {LButton Down}
    StartTime := A_TickCount ; Start count down after box is drawn.
    SetTimer, CaptureTimeout, 1000
    RestoreCursors()
    Return
}

Esc::
ForceAbortBoxCapture() {
    ToolTip, Aborting box capture.
    SetTimer, TurnOffToolTip, -1000
    ResetCaptureMode()
    RestoreCursors()
    Return
}

```

改好的GdOcrTool\_Cross.ahk： ~~遗憾，系统不允许上传完整的codes！~~

~~下载： [GdOcrTool\_Cross.ahk - Pastebin.com](https://pastebin.com/tiFWEGMT)~~ 我提供打包下载：

[GdOcrTool\_Cross 2021-11-25.zip](https://forum.freemdict.com/uploads/short-url/eTXxpTEe3Dt5RqfiCM14cjrzxBL.zip) (3.2 KB)

```auto
type or paste code here

```

---

_[View the full topic](https://forum.freemdict.com/t/topic/7166)._
