Keysharp - the resurrection of IronAHK

Talk about things KeySharp, some related to AutoHotkey or C#
User avatar
joedf
Posts: 8940
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: Keysharp - the resurrection of IronAHK

27 Aug 2020, 15:33

Maybe a special directive in the future...? :)
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
SOTE
Posts: 1426
Joined: 15 Jun 2015, 06:21

Re: Keysharp - the resurrection of IronAHK

27 Aug 2020, 17:55

boiler wrote:
27 Aug 2020, 11:25
Given the goal of making it as much like AHK as possible, it would make the most sense for array indexing to be the same as it is in AHK.
I agree with boiler. The core of those that will use Keysharp will be existing AHK users, that are using or will now experiment with non-Windows OSes, are involved with C# and .NET, or possibly involved in RDA/RPA. Makes sense to keep the switching between variants as smooth as possible. With Keysharp being aligned more with AHK v2, this will probably cause enough issues as it is and with the "moving target issue" since AHK v2 is still evolving and not locked into a Beta yet.

The other very important point would seem to be documentation. With Keysharp sticking close to AHK, people can often refer to the existing AHK help. Allowing Keysharp to keep its help file to just the minimum or differences, because that will take time to do build as well. As a reference, AutoHotkey_H help files kind of does this.

If something is done, than I think joedf's idea seems best, where there is a directive.
User avatar
Chunjee
Posts: 1402
Joined: 18 Apr 2014, 19:05
Contact:

Re: Keysharp - the resurrection of IronAHK

27 Aug 2020, 23:13

In my mind, Keysharp is ahk's best chance to become more compliant with programming norms. Only working on one OS; not normal. Using 1 as the starting index; not normal.

So I encourage Keysharp to make it an option at least.
but as always, I appreciate and encourage OP's efforts and will use Keysharp regardless.

One reason I bring this up as early as I can; is so mfeemster doesn't get coded into a corner where it gets to hard work around later.
Last edited by Chunjee on 29 Sep 2020, 08:16, edited 2 times in total.
SOTE
Posts: 1426
Joined: 15 Jun 2015, 06:21

Re: Keysharp - the resurrection of IronAHK

27 Aug 2020, 23:57

Chunjee wrote:
27 Aug 2020, 23:13
Using 1 as the starting index; not normal.
That's not entirely true, or at least its not something that outrageous or that AHK doesn't have company. A number of famous programming languages start at 1 or are flexible about it. Pascal/Object Pascal and Ada are flexible. Lua, Smalltalk, COBOL, Fortran, Julia, MATLAB, etc... default is 1. Just saying...
BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: Keysharp - the resurrection of IronAHK

01 Sep 2020, 16:20

Not sure if this is of any use (i.e. to create a new keysharp/AHK-command) https://stackoverflow.com/a/32527200
Keyword: virtual desktop / Win10
User avatar
mfeemster
Posts: 104
Joined: 24 Apr 2020, 18:30

Re: Keysharp - the resurrection of IronAHK

01 Sep 2020, 21:56

I have thought about the indexing thing, and have had some conversations with @Chunjee in Discord. Initially, I will leave indexing as 1-based, but will provide a #directive later on.

I am currently still trying to wrap up the file/dir functions. I'm almost done, just been hung up on the Ini file functions for a couple of weeks because I've been busy with other things.

Regarding the virtual desktop link, I've bookmarked it and will give it another look sometime in the future.

Regarding documentation, I've had some thoughts about that myself. I might just start with the AHK documentation, and insert my changes into it. Not sure though, we'll cross that bridge when we get there.

Thanks for the interest. This stuff is slow going, but we'll get there eventually.
BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: Keysharp - the resurrection of IronAHK

03 Sep 2020, 05:25

@mfeemster mster
Regarding documentation, I've had some thoughts about that myself. I might just start with the AHK documentation, and insert my changes into it. Not sure though, we'll cross that bridge when we get there.
The expert ! regarding the AHK documentation (IMHO by far), and especially for the reason that he's doing it on a constant basis (AFAIK, for ages now) is <f a n f a r e> :salute: :salute: @Ragnar :salute: :salute: Just for the records. I'd guess it's kinda 'must' to get in touch with him sooner or later. Thx for listening :)
User avatar
mfeemster
Posts: 104
Joined: 24 Apr 2020, 18:30

Re: Keysharp - the resurrection of IronAHK

03 Sep 2020, 15:26

Thanks @BoBo, I'll keep that user in mind when the time for documentation comes.

I would like to announce that I have finished the file/dir functions. All except for one: FileOpen() because that returns an object and I need to do some more work to get objects fully supported.

I will move onto the registry functions next. IronAHK has already started them, so it shouldn't be too much work to put on the finishing touches.
User avatar
mfeemster
Posts: 104
Joined: 24 Apr 2020, 18:30

Re: Keysharp - the resurrection of IronAHK

13 Sep 2020, 23:43

I have finished the registry functions. I will move onto the Drive functions next. IronAHK has already started them, so it shouldn't be too much work to put on the finishing touches.
SOTE
Posts: 1426
Joined: 15 Jun 2015, 06:21

Re: Keysharp - the resurrection of IronAHK

15 Sep 2020, 01:16

mfeemster wrote:
13 Sep 2020, 23:43
I have finished the registry functions. I will move onto the Drive functions next. IronAHK has already started them, so it shouldn't be too much work to put on the finishing touches.

Thanks for the update and good news.
:dance:
burque505
Posts: 1731
Joined: 22 Jan 2017, 19:37

Re: Keysharp - the resurrection of IronAHK

15 Sep 2020, 07:04

Thanks @mfeemster, that's great news.
Regards,
burque505
User avatar
mfeemster
Posts: 104
Joined: 24 Apr 2020, 18:30

Re: Keysharp - the resurrection of IronAHK

23 Sep 2020, 00:37

I have finished the drive functions. I was unable to fully test some because they deal specifically with CD drives and I don't have a CD drive on this laptop.

I will move onto the Process functions next. IronAHK has already done some of them, but V2 adds a few more.
User avatar
mfeemster
Posts: 104
Joined: 24 Apr 2020, 18:30

Re: Keysharp - the resurrection of IronAHK

28 Sep 2020, 20:22

I have finished the Process functions and will move on to the Screen functions. IronAHK has already started them, so it shouldn't be too much work to put on the finishing touches.

FYI, the Shutdown() function only seems to work when doing a logoff. A full shutdown or power off never seemed to work. Unsure how to solve this.
BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: Keysharp - the resurrection of IronAHK

01 Oct 2020, 04:15

BC I have no clue of that whole topic, you should ignore the following if being nonsense or unrelated: https://stackoverflow.com/a/11803470. Nevertheless, HTH and thx for your effort :thumbup:
User avatar
joedf
Posts: 8940
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: Keysharp - the resurrection of IronAHK

01 Oct 2020, 07:22

For windows, you'll likely want to use InitiateSystemShutdownEx :
http://msdn.microsoft.com/en-us/library/aa376874%28v=vs.85%29.aspx

There are probably system calls on Linux and macOS, but here's code golf with a bunch implementations:
https://codegolf.stackexchange.com/questions/107874/shut-down-the-computer
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
SOTE
Posts: 1426
Joined: 15 Jun 2015, 06:21

Re: Keysharp - the resurrection of IronAHK

30 Oct 2020, 12:17

Chunjee wrote:
11 Aug 2020, 07:18
mfeemster wrote:
11 Aug 2020, 07:14
it makes far more sense to do something like:
retval := func(x, y)

than

func(ref retval, x, y)
jc thank you. I call that output as arguments and it needs to go away forever.
I kind of overlooked commenting about this before, but ByRef parameters are in AHK_v2 and in other programming languages as well, though can be called by a different name like out parameters. In AutoHotkey, this can be avoided by returning an Object (Associative Array) or an Array. The ByRef or out parameter issue exists in other programming languages as well, and usually they also have alternative ways to return multiple results. In the AHK community, appears a lot of AHKers fell into the habit of using ByRef in their functions, which is why it was so widely seen. But it didn't have to be that way.

Help document examples:

Code: Select all

returnArray1() 
{
    Test := [123,"ABC"]
    return Test
}

returnArray2() 
{
    x := 456
    y := "EFG"
    return [x, y]
}

returnObject() 
{
    Test := {id: 789, val: "HIJ"}
    return Test
}

returnObject2() 
{
    Test := {}
    Test.id := 789
    Test.val := "HIJ"
    return Test
}
User avatar
mfeemster
Posts: 104
Joined: 24 Apr 2020, 18:30

Re: Keysharp - the resurrection of IronAHK

10 Nov 2020, 08:55

I took a month and a half off from this project, so it took me a while, but I've finished the Screen function. ImageSearch() was the hardest one.

I am now back to working on this regularly and will now implement the Monitor functions. IronAHK never implemented these, so I'll be doing them from scratch.
burque505
Posts: 1731
Joined: 22 Jan 2017, 19:37

Re: Keysharp - the resurrection of IronAHK

10 Nov 2020, 09:01

@mfeemster, thanks for the update, great news. Really looking forward to it.
Regards,
burque505
anaglypta
Posts: 17
Joined: 10 Nov 2020, 10:18

Re: Keysharp - the resurrection of IronAHK

10 Nov 2020, 10:30

@mfeemster:
If IronAHK has SysGet, that would have the Monitor functionality.
jeeswg's backport lib may give you other clues for where AHK v1 commands can be shaped into AHK v2 functions.
Thanks for working on this!
Last edited by anaglypta on 06 Feb 2021, 08:07, edited 2 times in total.
User avatar
mfeemster
Posts: 104
Joined: 24 Apr 2020, 18:30

Re: Keysharp - the resurrection of IronAHK

12 Nov 2020, 00:11

I have finished the Monitor functions. I will move onto the Sound functions next. IronAHK has already started them, so it shouldn't be too much work to put on the finishing touches.

Regarding the comments about monitor functions, it was fairly easy to do because C# has the System.Windows.Forms.Screen class which hides all of the tedious Windows API calls from the programmer.

Return to “KeySharp”

Who is online

Users browsing this forum: No registered users and 0 guests