Python Forum
pyahk autohotkey dll - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: pyahk autohotkey dll (/thread-16793.html)



pyahk autohotkey dll - bsayles - Mar-15-2019

hey everybody,

I'm new to trying to write ahk in python and I'm trying to build my first script using autohotkey dll and the ahk module. When i try to load the script into autohotkey I get the above error. Here is the code:

ahk = cdll.AutoHotkey
keyboard = ahk
parser = ahk

------> ahk.key_press(ahk.key_press(^+c, print, ahk.key_press(f, {enter}))

ahk.key_press(^+z, print, ahk.key_pres(u, {enter}))

ahk.key_press(ahk.key_press(^+x, print, ahk.key_press(m, {enter}))

cmp_func = CMPFUNC(py_cmp_func)
fx = create_string_buffer(str(cast(cmp_func, c_void_p).value))

ahk.ahkdll(pyclient, "", fx)
ahk.ahkassign(create_string_buffer("fx"), fx)
ahk.addScript(script)
ahk.ahkFunction(create_string_buffer("fx2"), create_string_buffer("Untitled"))

I've fixed the errors and it doesn't throw an error but it won't launch in either python terminal or autohotkey. What am I missing? Thanks for your help.