Skip to content

Instantly share code, notes, and snippets.

@JoeGlines
Last active April 26, 2021 15:39
Show Gist options
  • Save JoeGlines/e486cc7be417ea4671620dd101559a42 to your computer and use it in GitHub Desktop.
Save JoeGlines/e486cc7be417ea4671620dd101559a42 to your computer and use it in GitHub Desktop.
;*******************************************************
; Want a clear path for learning AutoHotkey; Take a look at our AutoHotkey Udemy courses. They're structured in a way to make learning AHK EASY
; Right now you can get a coupon code here: https://the-Automator.com/Learn
;*******************************************************
#SingleInstance force
Gui, +hwndMYGUI
;Gui, font, s16
;Gui Add, Text,, Draw in the picture box below`nPress E to toggle erasing.`nSwitching to erase mode also smooths the strokes.
;Gui Add, ActiveX, xm w600 h300 vss, msinkaut.InkPicture.1
Gui Add, Text,, Use handwriting recognition below (write letters and wait a bit)
Gui, add, edit, xm w600 r15 vdebug
Gui Add, ActiveX, xm w600 h100 vink, InkEd.InkEdit.1
ComObjConnect(ink, new ink_events)
ink.UseMouseForInput := 1
ink.InkInsertMode := 0
ink.Font.Size:=24
ss.backColor:=0x000000
ss.DefaultDrawingAttributes.Color:=0xffffff
ss.DefaultDrawingAttributes.FitToCurve:=1
Gui, Show
Return
#if (WinActive("AHK_ID " MYGUI))
e::
if (ss.CollectingInk=0)
{
toggle:=!toggle
ss.EditingMode:=toggle
}
return
^j::
value:=ink.text
msgbox %value%
return
#if
class ink_events
{
__Call(event, p*)
{
if (event != "mousemove")
{
GuiControlGet, debug
p1:=p[1],p2:=p[2],p3:=p[3],p4:=p[4]
GuiControl,, debug, %event%1: %p1%`t2: %p2%`t3: %p3%`t4: %p4%`n%debug%
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment