Porting an AutoHotKey project to Java

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Earil
Posts: 2
Joined: 16 Jan 2020, 15:15

Porting an AutoHotKey project to Java

16 Jan 2020, 15:29

Hello all,

I have been using AutoHotKey for the past 4 months, and have coded a sizable bot for a popular french online game that I use for myself. So far, it has been great to work using AutoHotKey, but being more familiar with Java, and considering the size of my project and the amount of additionnal functionalities that I intend to implement, I want to switch to this language.

The things that I like and use the most that are specific to AHK are the built-in functionalities such as mouse moving, clicking, simulated keyboard input, pixel/image detection. Therefore, I need a way to port these functionalities to Java, either by using existing Java libraries or by calling the built-in AHK functions from a Java program.

And I have absolutely no idea how to do that. By doing some Googling, I have found about the autohotkey.dll module, but I do not know how to use it, so if you know of any tutorial or documentation that would help understand how to use it, I would be extremely grateful. The alternative is to use existing Java libraries with similar functionalities but I don't know of them.

Thanks a lot for reading, and even more thanks if you can provide me with useful information !
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Porting an AutoHotKey project to Java

16 Jan 2020, 16:04

learn how java's ffi(foreign function interface) works
find out how to dynamically load a dll in java(msdn: loadlibrary equivalent)
create a Java function binding to autohotkey.dll's ahkthread
call ahkthread passing the script u want executed as a string, eg MouseMove 100, 100
Earil
Posts: 2
Joined: 16 Jan 2020, 15:15

Re: Porting an AutoHotKey project to Java

17 Jan 2020, 02:53

Thanks a lot, I will look into that asap !
TheBestPessimist
Posts: 21
Joined: 08 Apr 2018, 02:14

Re: Porting an AutoHotKey project to Java

02 Dec 2021, 09:01

Earil wrote:
17 Jan 2020, 02:53
Thanks a lot, I will look into that asap !
Do you have any updates on this journey? I would like to call AHK functions from Kotlin, so if someone has already done some groundwork, I would like to see it.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Chunjee, inseption86, jaka1, LuckyJoe, metallizer, Rohwedder and 338 guests