-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
To make full use of autohotkey for chart review, it's essential to read from the display, and recognize the date/person/exam etc... thus to start, we need autohotkey OCS module
- Loading branch information
Showing
1 changed file
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. | ||
; #Warn ; Enable warnings to assist with detecting common errors. | ||
SendMode Input ; Recommended for new scripts due to its superior speed and reliability. | ||
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. | ||
|
||
#CommentFlag Find the most recent patient visit | ||
|
||
|
||
;hotkey to activate OCR | ||
+!q:: | ||
getSelectionCoords(x_start, x_end, y_start, y_end) | ||
RunWait, C:\documents\mhk\Capture2Text\Capture2Text.exe %x_start% %y_start% %x_end% %y_end% | ||
MsgBox, In area :: x_start: %x_start% --> x_end: %x_end% , y_start: %y_start% --> y_end: %y_end%`n`nFound Text:`n`n%clipboard% | ||
return | ||
|
||
; creates a click-and-drag selection box to specify an area | ||
getSelectionCoords(ByRef x_start, ByRef x_end, ByRef y_start, ByRef y_end) { | ||
;Mask Screen | ||
Gui, Color, FFFFFF | ||
Gui +LastFound | ||
WinSet, Transparent, 50 | ||
Gui, -Caption | ||
Gui, +AlwaysOnTop | ||
Gui, Show, x0 y0 h%A_ScreenHeight% w%A_ScreenWidth%,"AutoHotkeySnapshotApp" | ||
|
||
;Drag Mouse | ||
CoordMode, Mouse, Screen | ||
CoordMode, Tooltip, Screen | ||
WinGet, hw_frame_m,ID,"AutoHotkeySnapshotApp" | ||
hdc_frame_m := DllCall( "GetDC", "uint", hw_frame_m) | ||
KeyWait, LButton, D | ||
MouseGetPos, scan_x_start, scan_y_start | ||
Loop | ||
{ | ||
Sleep, 10 | ||
KeyIsDown := GetKeyState("LButton") | ||
if (KeyIsDown = 1) | ||
{ | ||
MouseGetPos, scan_x, scan_y | ||
DllCall( "gdi32.dll\Rectangle", "uint", hdc_frame_m, "int", 0,"int",0,"int", A_ScreenWidth,"int",A_ScreenWidth) | ||
DllCall( "gdi32.dll\Rectangle", "uint", hdc_frame_m, "int", scan_x_start,"int",scan_y_start,"int", scan_x,"int",scan_y) | ||
} else { | ||
break | ||
} | ||
} | ||
|
||
;KeyWait, LButton, U | ||
MouseGetPos, scan_x_end, scan_y_end | ||
Gui Destroy | ||
|
||
if (scan_x_start < scan_x_end) | ||
{ | ||
x_start := scan_x_start | ||
x_end := scan_x_end | ||
} else { | ||
x_start := scan_x_end | ||
x_end := scan_x_start | ||
} | ||
|
||
if (scan_y_start < scan_y_end) | ||
{ | ||
y_start := scan_y_start | ||
y_end := scan_y_end | ||
} else { | ||
y_start := scan_y_end | ||
y_end := scan_y_start | ||
} | ||
} |