can I use python keyboard module with autohotkey dll

Post AHK_H specific scripts & libraries and discuss the usage and development of HotKeyIt's fork/branch
totalbs1
Posts: 4
Joined: 02 Mar 2019, 00:05

can I use python keyboard module with autohotkey dll

03 Mar 2019, 17:46

Hey everybody,

I'm new to writing hot keys of any form. I'm currently trying to expand on an ahk script and put it into a python script. Using python's keyboard package, I've been able to write what i want but I can't launch it without launching it in the terminal. I've read about autohotkey dll working with python. If I were to set ahk = autohotkey dll, would this make it so i can run this code like ahk in windows with a terminal? If not, is there a way to take the python script and run it in windows like ahk? It doesn't look like pyahk allows key presses. Can I use the autohotkey dll with keyboard as well so I can get the keyboard functionality? I have this code below:

Thanks for your help.
totalbs1
Posts: 4
Joined: 02 Mar 2019, 00:05

Re: can I use python keyboard module with autohotkey dll

13 Mar 2019, 18:52

I'd love to but autohotkey site isn't letting me, it tells me I'm blocked when I try to add the code.
totalbs1
Posts: 4
Joined: 02 Mar 2019, 00:05

Re: can I use python keyboard module with autohotkey dll

13 Mar 2019, 22:06

https://trinket.io/python/460142cd2f

it won't let me put the python code in the post but the code should be at the link above. Thanks for your help.
Last edited by gregster on 13 Mar 2019, 22:18, edited 1 time in total.
Reason: External link fixed
SOTE
Posts: 1426
Joined: 15 Jun 2015, 06:21

Re: can I use python keyboard module with autohotkey dll

14 Mar 2019, 05:47

totalbs1 wrote:
13 Mar 2019, 18:52
I'd love to but autohotkey site isn't letting me, it tells me I'm blocked when I try to add the code.
You can also use pastebin to post code, any kind of code.

https://pastebin.com/
HotKeyIt
Posts: 2364
Joined: 29 Sep 2013, 18:35
Contact:

Re: can I use python keyboard module with autohotkey dll

14 Mar 2019, 15:41

Would it not make more sense to use python dll in AutoHotkey?
burque505
Posts: 1736
Joined: 22 Jan 2017, 19:37

Re: can I use python keyboard module with autohotkey dll

17 Mar 2019, 15:01

@totalbs1, by chance I've been working on what is basically a self-tutorial for using AutoHotkey.dll in python. I don't know if it will give you any ideas, but here it is. You can run an AutoHotkey script in python (GUIs and all), pass variables back and forth between python and AHK, and call AHK functions from python. This is a pretty simple example, and I've used code that was taken from @HotKeyIt's post of many years ago and one from @tinku99, who appears to have vanished. By all means let me know if it steers you the wrong way. After all, it was basically for my own use, so what is clear to me may be mud to others. PS: Just tried to post the code but apparently PYTHON IS NOT ALLOWED :D Blocked by Cloudflare. Attaching zip.
Regards,
burque505

EDIT: Links to the original forum posts are this by tinku99 and this one by HotKeyIt.
Attachments
TameThePython2.zip
(2.27 KiB) Downloaded 169 times

Return to “AutoHotkey_H”

Who is online

Users browsing this forum: No registered users and 52 guests