In looking at this again, the solution might be to use Pascal. FPC (Free Pascal Compiler) can do cross-compiling into other OSes, including for Android. Interestingly, I have come across a few programs and programmers that seem to be blending AutoHotkey and Pascal.nnnik wrote: ↑11 Sep 2018, 11:10So you didn't understand what I wrote.
Java has no built in API to create Hotkeys for the entire system.
We would have to get an API that would provide it or built our own - in C/C++ or some other language that Java can use that can also implement super global hotkeys.
So in the end we would write our Hotkey code and most of the language features in C/C++ for Java to use in. Also we have to write a C library for every different OS.
So in the end we would rewrite AutoHotkeys core in Java and built the entire featureset into a dll/whatever linux uses for libraries which will will be shipped with the distribution !specific! for your OS.
the only thing that would change in comparison from now is the rebuilding of the AutoHotkey core in Java - which is more work than making AHKs current core modular and targeting different OSes.
So switching the language doesn't bring any benefits at all.
The other aspect of this though, is to divorce from the thinking that the AutoHotkey language is the same as the AutoHotkey interpreter written in C++. When thought of separately:
1) The feasibility of creating a transpiler (source to source compiler, https://en.wikipedia.org/wiki/Source-to-source_compiler) comes to mind.
Though it might be heresy for some, there have been a number of successful transpiler projects. Arguably, AutoHotkey is such a language to give it a shot. A transpiler seems to be a better way to go, as the AutoHotkey C++ source for the interpreter has become so large.
2) When a script is written in AutoHotkey, every option and command that the AutoHotkey interpreter provides isn't necessary.
This is an area where a transpiler has an advantage. Only the relevant needed code, for a specific script/program, is translated into Pascal.
3) Every aspect and command of AutoHotkey for Windows doesn't necessarily have to be ported over to a different OS, for such a transpiler to be highly useful.
Many of AutoHotkey application building features look "linguistically" transferable to Object Pascal and LCL (Lazarus Component Library). "Linguistically", as in the AutoHotkey language to it's near equivalents in the Object Pascal language, and not direct porting of existing C++ code to Object Pascal code.
There are certain automation features and commands of AutoHotkey that might need workarounds, but the possibility does seem there.