Keysharp - the resurrection of IronAHK

Post a reply


In an effort to prevent automatic submissions, we require that you complete the following challenge.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :| :mrgreen: :geek: :ugeek: :arrow: :angel: :clap: :crazy: :eh: :lolno: :problem: :shh: :shifty: :sick: :silent: :think: :thumbup: :thumbdown: :salute: :wave: :wtf: :yawn: :facepalm: :bravo: :dance: :beard: :morebeard: :xmas: :HeHe: :trollface: :cookie: :rainbow: :monkeysee: :monkeysay: :happybday: :headwall: :offtopic: :superhappy: :terms: :beer:
View more smilies

BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Keysharp - the resurrection of IronAHK

Re: Keysharp - the resurrection of IronAHK

Post by mfeemster » 23 Jan 2024, 17:45

I've made a new release, 0.0.0.6.

The new place to post for this project this stickied thread: viewtopic.php?f=81&t=125220

So I am going to stop updating this thread now.

Re: Keysharp - the resurrection of IronAHK

Post by joedf » 15 Jan 2024, 11:54

Okay, I've made a post about this idea here: viewtopic.php?f=2&t=124920
So that this a dedicated place for it. Please give your input! :thumbup:

Re: Keysharp - the resurrection of IronAHK

Post by thelegend » 15 Jan 2024, 09:39

SOTE wrote:
15 Jan 2024, 08:26
Seems like you might want to go ahead and ask/allow there to be a Keysharp subforum, like there is for AutoHotkey_H. Y
I'm one of those random people that saved this thread to get notifications of how the project is moving forward. And I think a subforum is a great idea!

Re: Keysharp - the resurrection of IronAHK

Post by SOTE » 15 Jan 2024, 08:26

mfeemster wrote:
02 Jan 2024, 11:04
  • The editor with line numbers in Keyview is very sub-optimal. It's based on a control I found and copied. If anyone knows how to make IDE style code editors, I would greatly appreciate help improving Keyview. Adding support for multiple files would be nice too.
Something that you might want to add or think about it, is a simple macro recorder (or as separate tool called from Keyview) and compiler option (to .exe and .dll), combined with Keyview. I think it's almost inevitable that this would come up.
  • The more eyes on this project, the better. I'm sure there are still many bugs lurking. So a good way to find them would be to port well known AHK v2 projects piece by piece using Keyview, then reporting bugs on bitbucket or in the Discord.
Seems like you might want to go ahead and ask/allow there to be a Keysharp subforum, like there is for AutoHotkey_H. You are kind of tucked away, so don't think this thread or its importance is so obvious to random visitors. Having the Keysharp subforum seems like it would naturally help put more eyes on the project. In addition to that, maybe add to SourceForge (https://sourceforge.net/). I've seen lots of alphas (and almost alphas) added there, and your project is much further along than many I've seen posted. This could help get some interesting outsider perspectives, in addition to AHKers.

To help people along, maybe have an example section on the Keysharp subforum and at SourceForge. This would encourage people to try or port over their AHK v1 and v2 scripts to Keysharp, and see how things go.

Re: Keysharp - the resurrection of IronAHK

Post by mfeemster » 14 Jan 2024, 15:54

Thanks @SOTE, I am continuing to work on it. Finding and fixing bugs. What I'm doing to test is taking the various *.ahk scripts that come with the AHK v2 installer, and making sure Keysharp can properly parse and run them. This is revealing many bugs and I am fixing them one by one. For example, I can run WindowSpy.ahk now with minimal modifications.

Regarding linux, Phil and I have had a voice chat session on Discord to go over some of the basics.

For the time being, I am going to continue working on getting the Windows build working properly.

Re: Keysharp - the resurrection of IronAHK

Post by SOTE » 14 Jan 2024, 13:15

mfeemster wrote:
02 Jan 2024, 11:04
Release 0.0.0.5 has been posted on the downloads page here:

https://bitbucket.org/mfeemster/keysharp/downloads/

The usual list of caveats and differences from AHK v2 are here:

We've ticked off all of the remaining features to get parity (minus caveats above) with AHK v2.
The continual progress is fantastic. :dance:
  • One of the original purposes of this project is to get it working on Linux. Some parts of the code are cross platform, but other parts are very Windows specific. Trying to find the equivalent Linux calls is going to be a substantial effort. I would greatly appreciate help if someone could begin researching this. I can go over the code with them on Discord so they are not shooting in the dark. Note: Wayland prohibits much of what we want to do, so this will be an X11-only effort.
It appears that one of the best AHKers for this is phil294 (@phil294). He has mentioned your project and has created an AHK v1 classic semi-clone for Linux. You guys collaborating would probably be the optimal situation.

Re: Keysharp - the resurrection of IronAHK

Post by mfeemster » 02 Jan 2024, 11:04

Release 0.0.0.5 has been posted on the downloads page here:

https://bitbucket.org/mfeemster/keysharp/downloads/

The usual list of caveats and differences from AHK v2 are here:

https://bitbucket.org/mfeemster/keysharp/src/master/

We've ticked off all of the remaining features to get parity (minus caveats above) with AHK v2.

This last push included:

  • Getting ComCall(), DllCall() and the sound functions fully working
  • Implementing AHK's concept of threads
  • Fixing numerous parsing bugs
  • Upgrading to .NET 8
We've also added the ability to launch real threads which are independent of the usual "green" threads. This was done to accommodate users of AHK_H who desire that functionality.

So with this major milestone met, the question is: where do we go from here? I have some thoughts:

  • The parser is done in a very bad way, using all sort of string splits and special checks for edge cases. This makes parsing bugs extremely hard to fix. The ideal way would be to make a legitimate grammar and parser with a tool like ANTLR. I would very much appreciate if someone could begin looking into this, and we can coordinate in the #keysharp channel in Discord. I really need help here because I don't have the time or know-how to do it.
  • The editor with line numbers in Keyview is very sub-optimal. It's based on a control I found and copied. If anyone knows how to make IDE style code editors, I would greatly appreciate help improving Keyview. Adding support for multiple files would be nice too.
  • The more eyes on this project, the better. I'm sure there are still many bugs lurking. So a good way to find them would be to port well known AHK v2 projects piece by piece using Keyview, then reporting bugs on bitbucket or in the Discord.
  • One of the original purposes of this project is to get it working on Linux. Some parts of the code are cross platform, but other parts are very Windows specific. Trying to find the equivalent Linux calls is going to be a substantial effort. I would greatly appreciate help if someone could begin researching this. I can go over the code with them on Discord so they are not shooting in the dark. Note: Wayland prohibits much of what we want to do, so this will be an X11-only effort.

Those are my thoughts at this point, I welcome input.

Re: Keysharp - the resurrection of IronAHK

Post by mfeemster » 09 Oct 2023, 10:50

I am happy to announce testing release 0.0.0.4 has been posted on the downloads page here:

https://bitbucket.org/mfeemster/keysharp/downloads/

The usual list of caveats and differences from AHK are here:

https://bitbucket.org/mfeemster/keysharp/src/master/

This version fixes numerous parsing bugs, and also adds support for function reference parameters as well as dynamic properties used with functions such as DefineProp(), DeleteProp() etc...
Miscellaneous new functionality has also been added in various areas.

OwnProps was another of the last major functional areas to check off, so this release is an important step forward.

The remaining areas of functionality are COM (partially done), DllCall() (mostly done) and finally figuring out a threading model. That last one would benefit from some user input so we can get an idea of how users want threads to work and what the term "thread" should actually mean within Keysharp. We are always in the #keysharp channel under community projects in the Discord, so please feel free to join and opine on threads.

Re: Keysharp - the resurrection of IronAHK

Post by mfeemster » 13 Sep 2023, 10:01

When initially developing Keysharp, I didn't think it was possible for it to support reference function parameters like:

Code: Select all

func(&p)
So the notes always said they are not supported. I got to thinking and came up with a way to implement them about a week ago. I committed the code last night, so function reference parameters are now supported.

I am still having trouble with COM and various parts of DllCall(), but I am going to punt on those for now.

Next I am going to work on dynamic properties or "OwnProps" and see how far I can get.

Re: Keysharp - the resurrection of IronAHK

Post by boiler » 31 Jul 2023, 09:42

Moderator note: Removed replies that were off-topic editorial comments and questions (and inappropriate).

Re: Keysharp - the resurrection of IronAHK

Post by mfeemster » 10 Jul 2023, 15:02

No, there is no support at all for Keysharp on Linux yet. I am trying to get the Windows part fully working first. I have almost all of it implemented, but there are a few remaining pieces that I am stumbling on. Namely: threads, COM and OwnProps in classes. After it's fully working, I'll begin the Linux work.

Edit:

In addition, I have discussed this with some members and we've spotted a problem: You can do mouse/keyboard event hooks with X server, however you cannot with Wayland. Many distros are moving to Wayland. So we are unsure what to do here until we find out how Wayland plans to support/allow global keyboard hooks.

Re: Keysharp - the resurrection of IronAHK

Post by Sterwe » 09 Jul 2023, 11:28

I tried to use Keysharp in Linux Mint, unfortunately I always got the error message that the "Keysharp.exe" could not be found.
So I would like to ask for help here.
One question is, is Linux supported by Keysharp.

My OS data:
OS: Linux Mint 21.1
.Net runtimes:
Microsoft.AspNetCore.App 7.0.8
Microsoft.NETCore.App 7.0.8

My procedure
I downloaded the keysharp 0.0.0.3.zip from Bitbucket and unpacked it
after that I opened a terminal window to the folder where keysharp is located.
Here is the extract from the terminal window:
~/Downloads/Keysharp 0.3$ dotnet .\keysharp.exe hello.ahk
The command could not be loaded, possibly because:
* You intended to execute a .NET application:
The application '.keysharp.exe' does not exist.
* You intended to execute a .NET SDK command:
No .NET SDKs were found.

Download a .NET SDK:
https://aka.ms/dotnet/download

Learn about SDK resolution:
https://aka.ms/dotnet/sdk-not-found
steffen@steffen-ASUS-TUF-Gaming-A17-FA706IU-FA706IU:~/Downloads/Keysharp 0.3$


Can somebody please tell me if I'm doing something wrong?
Thank for your help

Re: Keysharp - the resurrection of IronAHK

Post by SOTE » 29 Jun 2023, 02:53

mfeemster wrote:
15 Jun 2023, 08:40
I've added support for fat arrow functions and have fixed many bugs. For those interested in testing, see here: https://bitbucket.org/mfeemster/keysharp/downloads/
Very nice and thanks for doing that. Makes it much more convenient and accessible to follow the progress.

Re: Keysharp - the resurrection of IronAHK

Post by mfeemster » 15 Jun 2023, 08:40

I've added support for fat arrow functions and have fixed many bugs. For those interested in testing, see here: https://bitbucket.org/mfeemster/keysharp/downloads/

Please give me feedback either here or in the #keysharp channel on Discord.

Thanks.

PS: @SOTE I have updated the very first post on this thread to include the download link at the top.

Re: Keysharp - the resurrection of IronAHK

Post by burque505 » 02 Jun 2023, 10:11

I'm happy to report that at least some COM code can work in both AHK v2.0.2 and Keysharp v0.0.2 without alteration.

Code: Select all

oWord := ComObject("Word.Application")
oWord.visible := True

;oWord.Documents.Open(A_ScriptDir . "\Range.docx") ; New document
oWord.Documents.Add()

oWord.selection.font.bold := True 
oWord.selection.TypeText("Visit ")

oWord.activeDocument.Hyperlinks.add(oWord.selection.range, "https://www.autohotkey.com","","","AHK site ")

oWord.selection.TypeText("to learn more about ")
oWord.selection.font.Italic := true

oWord.selection.TypeText("Autohotkey")
oWord.selection.font.bold := False
oWord.selection.font.italic := False

oWord.selection.TypeText(".")
oWord.selection.TypeParagraph()
oWord.selection.TypeText("That's all, folks!")

oWord.Activate()
I had some issues with the installer this morning, so I just compiled from source and installed, using the the setup.exe and keysharp.msi produced by VS 2022.

Re: Keysharp - the resurrection of IronAHK

Post by mfeemster » 22 May 2023, 09:39

Thanks @SOTE, I'm discovering some more bugs that I am hard at work on. I would prefer to get things much more solid before elevating the visibility of the project. Otherwise, I'll get flooded with bug reports.

Re: Keysharp - the resurrection of IronAHK

Post by SOTE » 22 May 2023, 02:48

mfeemster wrote:
04 May 2023, 03:00
It is with great pleasure that I announce an initial release of Keysharp.

A Windows installer and portable zip file can be found here: https://bitbucket.org/mfeemster/keysharp/downloads/
Shouldn't the download link be added to the first page too. After a while and more posts, people will miss what was on page 10, when the latest page is say 15.

Re: Keysharp - the resurrection of IronAHK

Post by SOTE » 22 May 2023, 02:36

It is fantastic that Keysharp has reached this point. :dance: :bravo:

Wondering if this project should be mirrored on SourceForge (https://sourceforge.net/) or on GitHub too. This exposes Keysharp to more random or newbie users, who knew nothing about automation or the rich history. An argument could be made about how things show up in Google and Bing, so some other places might be good. If not now, maybe something to think about for the future.

Also, perhaps it's time for Keysharp to have its own subforum, like AutoHotkey_H does. This is more or just as much related to AHK, than it is to discussing C# in general.

Re: Keysharp - the resurrection of IronAHK

Post by burque505 » 04 May 2023, 08:20

I'd like to thank @mfeemster very much for all his work on this project.
Please feel free to post here with questions and to report issues. To the extent I can I'll respond while @mfeemster is not available.

I've uninstalled and reinstalled Keysharp many, many times in the last few months, following each commit. I have not had a single issue with path corruption. Uninstalling removes Keysharp from the path, but leaves all other entries intact. I suggest adding Keysharp.exe to your path (the option is probably already checked in the installer) if you plan to do a bit of experimenting. Of course you can do that manually even if you're just running the portable version.
Do read the 'readme.md' at the github repo.

The file 'guitest.ks' at this folder in the Bitbucket repo , although still very much a work in progress, makes use of nearly all the controls and GUI functionality of Keysharp. Running and examining that code will give you a good head start on working with Keysharp. Please download al the files in that folder to ensure the GUI works properly. N.B.: A few last-minut tests toward the end have not made it into the version of guitest.ks at the Bitbucket repo, but they are in any event minor and will make their way into the code soon.

There are a few examples of working scripts at this url also. You'll notice that nearly all the tests in this folder and in the root of this folder have files with .ahk extensions. To run them from the command line, of course your system will have to be able to find Keysharp.exe. If you dare to use the installer (or use the portable version and modify the path) you can simply run e.g. 'C:\YourFolder\keysharp\assign-dyn-var.ahk'. Rename it with a '.ks' extension and you can run 'C:\YourFolder\keysharp\assign-dyn-var.ks'.

Regards,
burque505

Re: Keysharp - the resurrection of IronAHK

Post by mfeemster » 04 May 2023, 03:00

It is with great pleasure that I announce an initial release of Keysharp.

I began this long journey during the start of the lockdowns in 2020 and have worked almost non stop on it for three years. So this is a momentous occasion.

Over the past year, @burque505 has helped substantially with testing and feedback. A big thanks goes to him.

You can find a lengthy writeup of how to run it and what to expect here: https://bitbucket.org/mfeemster/keysharp/src/master/

A Windows installer and portable zip file can be found here: https://bitbucket.org/mfeemster/keysharp/downloads/

We are calling this version 0.0.0.1, signifying that it is going to be very primitive, unpolished, buggy, unreliable and rough around the edges. Despite mine and @burque505 's best efforts, heavy unit testing, and fixing well over 100 bugs, we are sure you will help us find many, many more.

Before you start coding, be mindful of the list of differences between Keysharp and AHK listed above.

I recommend starting off your testing with very small scripts to ensure the basic functionality works as you'd expect, then build up from there.

I also recommend writing your code in the Keyview.exe program which is contained in the installer and zip file. This will allow you to see in real-time whether your script code can be properly compiled without syntax errors. It's a very primitive editor, and I hope to get help from you in the future to make it better.

For quick questions, post them here or ask in the Discord. For serious bug reports, please make an account on bitbucket.org and post under the Issues page so we can track progress on fixing them.

I'm headed out of town for a few days, hopefully there will be a lot of feedback next week when I return.

:D

Top