Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port to AHK v2 #16

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Port to AHK v2 #16

wants to merge 5 commits into from

Conversation

greener-hayden
Copy link

I have ported the AHK code so its able to run on AHK v2. The code has been stable but there could be outliers or problems that i haven’t encountered yet so be warned. The only thing missing from this conversion is the validation of whether a method exists. So, if the user presses a key that hasn’t been updated, it will result in an error so keep that in mind.
In addition, I am currently working on integrating a plugin with Flow-Launcher. There is also a possibility of integrating with Powertoys Run, but for now, my focus is on Flow since it seems like a more agile system since i can build the plugin with python.

I also have plans to enhance the code options by allowing users to set parameter values for the methods. Improving the ability of the plugin on stream deck. I also have plans to add descriptions/flavour text to functions. Which should improve the aesthetics of hooking HotkeylessAHK to other things.

I have ported the AHK code so its able to run on AHK v2. The code has been stable but there could be outliers or problems that i haven’t encountered yet so be warned. The two things missing from this conversion is the validation of whether a method exists. So, if the user presses a key that hasn’t been updated, it will result in an error so keep that in mind. Another missing part is the extra stuff for killing the server and ahk in the lib.ahk.

For some reason I was experiencing problems with killing the node server followed by killing the AHK for some odd reason so for now i moved it over to the main ahk to save time. If you want to tackle that feel free to do so. I just wanted to get this released as quickly as possible so others can start using AHK v2 or fix any issues that i may have missed.

In addition, I am currently working on integrating a plugin with Flow-Launcher. There is also a possibility of integrating with Powertoys Run, but for now, my focus is on Flow since it seems like a more agile system since i can build the plugin with python.

I also have plans to enhance the code options by allowing users to set parameter values for the methods. Improving the ability of the plugin on stream deck. I also have plans to add descriptions/flavour text to functions. Which should improve the aesthetics of hooking HotkeylessAHK to other things.
Added support for parameters, allowing the passing of various types of data such as strings and variables to a selected function. Currently has support for strings, integers, floats, boolean, arrays, objects, and nulls. However, I couldn’t figure out how to pass mathematical operations, so it’s not a complete one-to-one conversion of what you can include in the (params) in the file itself. Nevertheless, it covers about 90% of the functionality and 100% of what I needed.

In addition, I have made several other changes, including automating performance tests. I have been working on this rewrite gradually over the past three months, resulting in numerous minor tweaks that I can’t recall off the top of my head. I hope this pull benefits those who have been considering switching to hotkeylessAHK and preferred not to write 1.1 code.
@greener-hayden
Copy link
Author

Could you please look over this pull @sebinside ?
I've now added support for parameters. Currently can do strings, integers, floats, boolean, arrays, objects, and nulls. However, I couldn’t figure out how to pass mathematical operations, so it’s not a complete one-to-one conversion of the method(params*). Nevertheless, it covers about 90% of the functionality and 100% of what I needed.

I hope that the port is at the quality that it could be merged.

image

Reinstated save-then-update sequence for improved functionality. Fixed an issue with the shutdown button that was previously overlooked due to infrequent use. The shutdown button is now functioning as expected."
@sebinside
Copy link
Owner

Thank you for this giant PR! Looks like a great improvement of the overall code base. However, I will need to find quite some time to review (and first, to understand) the changes and additions. In my current extremely tight schedule, this will probably take some time, I'm sorry. Still, thank you very much, this PR will eventually be merged :)

@greener-hayden
Copy link
Author

Multiple Function Class Support

This update introduces support for multiple function classes, allowing for better organization and separation of functions based on their purpose or context. For example, you can now have classes like WorkFunctions, PersonalFunctions, etc., in addition to the main CustomFunctions class.

The changes made include:

  • Added support for multiple function classes in the GetAvailableFunctions() function. The functionClasses array can be expanded to include additional function classes as needed.
  • Modified the register endpoint to handle multiple function classes. It now extracts the function class and function name from the registered list and stores them in the functionClassMap.
  • Updated the send endpoint to find the corresponding function class for a given function name using the findFunctionClass method. If a matching function class is found, the command is sent with the appropriate class prefix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants