【GdOcrTool】即指即译,OCR取词工具

@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”放在GoldenDict.exe所在目录,启动即可。

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

这里下载:GdOcrTool_Cross 2021-11-25.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 出手定证。

具体改动如下

把下面的

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

换成:

^`::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()

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 我提供打包下载:

GdOcrTool_Cross 2021-11-25.zip (3.2 KB)

type or paste code here
2 个赞