| View previous topic :: View next topic |
| Author |
Message |
jonny
Joined: 13 Nov 2004 Posts: 3004 Location: Minnesota
|
Posted: Wed Mar 23, 2005 2:59 am Post subject: AutoHotkey on Linux! |
|
|
So far I have only tested MsgBox, and I find it very encouraging that it works. I'm using Wine for this, btw. Below is an illustrated report of all I've done so far. To be kind to those on dialup, I haven't hotlinked the images.
Screenshot 1
Screenshot 2
Screenshot 3
Screenshot 4
Screenshot 5
Screenshot 6
The graphical install went smoothly, as I expected; nothing in standard Windows installs scare Wine, usually. [1..6]
Screenshot 7
Window Spy didn't work very well at all [7], so I'm having doubts about some of the window detection functions. We'll see later. It still reads the resolution and colors well, since they're probably basic API's that Wine has already implemented.
Screenshot 8
This is the result of the first AHK script ever run on a Linux machine (let's make a holiday ). It shows a neat little message box [8]. For anyone who can't automatically convert a Gui to AHK code in their head:
| Code: | msgbox,Hello, world!
return |
Screenshot 9*
It also ran perfectly as a compiled executable; the result was identical [8]. The compiler didn't give Wine any trouble at all, and it actually gave me more output then I've ever seen in Windows! [9]
This is only the tip of the iceberg. I'll have a lot more to come later on. Specifically I'll be testing file manipulation and Gui's, both of which I am hopeful for. But the big one I'm still hesitant about.... hotkeys!
*Don't let the screenshot mislead you; Smith is not my surname. It's the hostname of my computer (named after the Matrix character).
Last edited by jonny on Wed Mar 23, 2005 5:10 am; edited 1 time in total |
|
| Back to top |
|
 |
jonny
Joined: 13 Nov 2004 Posts: 3004 Location: Minnesota
|
Posted: Wed Mar 23, 2005 3:46 am Post subject: |
|
|
Screenshot 10
As I suspected, hotkeys do not work. Here is the script:
| Code: | | space::msgbox,Hello, world! |
The output implies that it never receives the hotkey at all [10]. However, the script both shows up in the tray and runs the main window, so we can at least isolate the problems to the method used to receive hotkeys.
Screenshot 11
Here I've tried hotkeys once more, but this time with the use of the hook. Since Wine specifically states that it runs at the user level only and cannot do anything lower-level, I wasn't expecting much. AutoHotkey correctly relates that it was not successful in installing the keyboard hook, probably because Wine denied its API call [11]. The script used was identical to the one above, but with the #InstallKeybdHook and #UseHook directives.
I'll also note that the syntax checking works fine (yes, I deliberately tested it ). From the above testing, I'll conclude that most of AutoHotkey's input methods will fail due to lack of lower-level access. I'll move on to Gui's now. (I might also add that without input methods, AutoHotkey falls somewhat short of AutoIt3. I'll eventually test that on Wine as well, but most of what it can do is already covered by existing scripting languages.) |
|
| Back to top |
|
 |
corrupt
Joined: 29 Dec 2004 Posts: 2436
|
Posted: Wed Mar 23, 2005 3:49 am Post subject: |
|
|
I haven't tested a script with hotkeys yet but any Gui scripts I have tested seem Ok so far on RH FC3 with Wine ... |
|
| Back to top |
|
 |
jonny
Joined: 13 Nov 2004 Posts: 3004 Location: Minnesota
|
Posted: Wed Mar 23, 2005 3:58 am Post subject: |
|
|
| Oh yes, I forgot to mention that I'm running Gentoo. Also, I just realized something which should've been obvious from the start... AutoHotkey will always be confined to the virtual C: drive Wine runs it in! This obviously degrades its usefulness for almost anything other than Gui's. I'm currently testing the clipboard, and then I'll try gui's. |
|
| Back to top |
|
 |
jonny
Joined: 13 Nov 2004 Posts: 3004 Location: Minnesota
|
Posted: Wed Mar 23, 2005 5:06 am Post subject: |
|
|
Screenshot 12
I was pleasantly surprised to find the clipboard in good order [12]. The msgbox shows the clipboard, which is also the script itself. I'm still thinking of a good way to test clipboardall.
Writing to the clipboard was a different story; the first time it's accessed, it leaves the previous contents untouched, and the second time it simply wipes it (regardless of what the intended assignment was). This behavior is consistent and reproducible.
That's all the more I'm going to do tonight; tomorrow night I'll have a much longer post, and hopefully more detailed. |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10480
|
Posted: Wed Mar 23, 2005 9:43 pm Post subject: |
|
|
I'm a little surprised hotkeys don't work. Perhaps you could try a more typical hotkey such as these two: | Code: | #p::
^!p::
MsgBox You pressed %A_ThisHotkey%.
return |
I'm not sure what could be causing the clipboard misbehavior.
Thanks for posting such elaborate findings! |
|
| Back to top |
|
 |
jonny
Joined: 13 Nov 2004 Posts: 3004 Location: Minnesota
|
Posted: Wed Mar 23, 2005 10:01 pm Post subject: |
|
|
| Sorry, that doesn't work either. I might also note that alwost every Window Manager in Linux has their own hotkey handlers (often more than one), and these might interfere with it. I'm sure the method you use is pretty basic, but it would probably still require a little effort to truly port it (if any such effort were made in the future). Also, like I hypothesized, it might just be Wine denying the API needed. If it were ported to X, it might run as is (but that mould probably be harder than it sounds). |
|
| Back to top |
|
 |
daonlyfreez
Joined: 16 Mar 2005 Posts: 755 Location: Berlin
|
Posted: Mon Mar 28, 2005 6:52 pm Post subject: |
|
|
Maybe this could be the starting point of a *nix version of AutoHotkey (far, far in the future, probably...)? _________________ (sorry, homesite offline atm) |
|
| Back to top |
|
 |
jonny
Joined: 13 Nov 2004 Posts: 3004 Location: Minnesota
|
Posted: Tue Mar 29, 2005 3:16 am Post subject: |
|
|
| If anyone's been wondering where I was, I was up at Lake Superior skiing. But hey, I'm back! Anyway, about Claro; I don't think it's entirely realistic at this point to rewrite AutoHotkey with new libraries just so it could work on Linux, but it's definitely something to look forward to. |
|
| Back to top |
|
 |
schlemihl1277
Joined: 09 Jul 2005 Posts: 10
|
|
| Back to top |
|
 |
jonny
Joined: 13 Nov 2004 Posts: 3004 Location: Minnesota
|
Posted: Sat Oct 01, 2005 2:15 am Post subject: |
|
|
| @schlemihl1277: Thank you for your contributions. Over the summer, I've become much more fluent in Linux and realized that such tools are redundant if you have a good window manager and xmodmap, but I can see that some of the tools you've suggested could prove useful in their own right. |
|
| Back to top |
|
 |
schlemihl1277
Joined: 09 Jul 2005 Posts: 10
|
Posted: Sun Oct 02, 2005 8:44 pm Post subject: |
|
|
Hi Jonny,
Fine that you can handle your scripting tasks under linux. But have you an idea how to manage an equivalent for the AHK-function "ImageSearch" in Linux?
Best regards.
schlemihl1277 |
|
| Back to top |
|
 |
jonny
Joined: 13 Nov 2004 Posts: 3004 Location: Minnesota
|
Posted: Mon Oct 03, 2005 1:40 am Post subject: |
|
|
No, I don't. I've never had a use for such a function, so I've never looked. Sorry.  |
|
| Back to top |
|
 |
AHKnow* Guest
|
Posted: Wed Oct 05, 2005 1:20 am Post subject: |
|
|
Why not continue to see how much AutoHotkey can do in Linux? It seems AutoHotkey already has some basic funtionality and could have more with some.
I guess a big advantage is that scripts made in Windows, could often run on Linux too. If somebody made a utility, game, etc... on Windows than their Linux pals could use them too. This ability just opens up the market and user base for AutoHotkey.
If you used another Linux program than you would not be able to run the same scripts on both Windows and Linux, and not by using AutoHotkey. |
|
| Back to top |
|
 |
Thalon
Joined: 12 Jul 2005 Posts: 640
|
Posted: Wed Dec 21, 2005 12:46 pm Post subject: |
|
|
Is there any actual info? The screenshots do not work any more...
I was asked if a tool of mine could be run also on Linux. It doesn't use any Hotkeys.
It uses many GUI-Features (also Listview), all other is String-handling and reading/writing from/to files...
Should this be possible with such an emulator?
Thalon _________________ AHK-Icon-Changer
AHK-IRC
deutsches Forum
SacredVault |
|
| Back to top |
|
 |
|