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

Dramatic time increase for Subscribing to keys on newer version #98

Open
Anutim opened this issue Dec 23, 2022 · 6 comments
Open

Dramatic time increase for Subscribing to keys on newer version #98

Anutim opened this issue Dec 23, 2022 · 6 comments
Labels
AHK-v2 Issues relating to port of AHI to AHK v2

Comments

@Anutim
Copy link

Anutim commented Dec 23, 2022

Hey, I just switched on to moving my AutoHotInterception scripts to v2, so figured I'd get the latest version too.

I repeatedly Subscribe and Unsubscribe depending on if a condition is met, and upon finishing transition to the latest version, I realized that Subscribing multiple keys in a row is taking ages.

At first I figured I had probably ported AHI to v2 incorrectly somehow, so I went back to v1 and tried the latest version there.
Exact same issue.

To further detail what happens:
Once subscriptions have been done (logging the functions in AHK, it seemingly goes very fast), pressing any of the subscribed keys won't do anything for a while (as extreme as 10 subscriptions taking like 10 seconds?).
Until suddenly, all the keystrokes appear to be processed at the same time, creating a huge spam.
Afterwards it works as normal, until it's time to re-subscribe.

Old version I was on (0.5.0), there wasn't really any noticeable lag after subscribing, it felt instant.
And I haven't tried any version in-between until latest (0.8.0), so couldn't really say when the problem was introduced.

@LAPIII
Copy link

LAPIII commented Feb 12, 2023

Can you upload your ported AHI to v2? And one of your scripts using it, assigning hotkeys to keyboard keys? I'm trying to get into using AHI and would like a better example than what has been provided on this Github page.

@Anutim
Copy link
Author

Anutim commented Feb 12, 2023

https://cdn.discordapp.com/attachments/195652955662319636/1074391409425141830/AutoHotInterception.ahk (0.5.2)
https://cdn.discordapp.com/attachments/195652955662319636/1074391423153098762/CLR.ahk
https://cdn.discordapp.com/attachments/195652955662319636/1074391712820105288/anuAHI.ah2

Holding down a key will keep sending multiple calls similar to Windows default "Hold key to spam it" functionality, so this is what I do to avoid that (per function):

Function(state){
        static previousState := 0
        if (state == previousState)
            return
        previousState := state

        if (state)
            ThingToDo()
}

@evilC
Copy link
Owner

evilC commented Mar 21, 2023

I have an initial branch of AHI for AHK v2 here
If you can reproduce issues mentioned with this branch, please let me know

@evilC evilC added the AHK-v2 Issues relating to port of AHI to AHK v2 label Mar 21, 2023
@Anutim
Copy link
Author

Anutim commented Mar 21, 2023

Issue persists.

Also, unsure why, but switching to it also randomly crashes two games I've tried while using it?
No idea what's going on there or how to start troubleshooting it.

@MartinLichtblau
Copy link

MartinLichtblau commented Aug 30, 2023

I have the same issue. Latest AHI version v0.9.1 with AHKv1.
It may seem only like a minor nuisance, but when reloading frequently, e.g. when developing/debugging it becomes annoying. Sadly, some functions, where you subscribe just in time, become unusable because of the lag.

@MartinLichtblau
Copy link

v0.7.0 works fine. So bug was introduced in v0.8.0 .?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AHK-v2 Issues relating to port of AHI to AHK v2
Projects
None yet
Development

No branches or pull requests

4 participants