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

When running TypingAid with AHK v1.1, Input sometimes stops being detected #13

Closed
ManiacDC opened this issue Oct 30, 2014 · 2 comments
Closed
Assignees
Labels
Milestone

Comments

@ManiacDC
Copy link
Owner

I am experiencing a problem where my script will suddenly (and seemingly randomly) stop detecting my keyboard input. This happens upon switching away from my text editor. I'm not even getting to the code following the Input command. I know my script is still working because if I switch windows, my 100 ms timer to detect a window switch kicks in.
This did not happen with AutoHotKey 1.0.48.5.

As you can see from the pasted key history below, the keyboard hook is enabled. The reason I suspect the keyboard hook is two-fold:

  1. There is no keyboard input in the below pasted keyboard history excerpt (I trimmed some entries, but they are all for the mouse). I switched to this window directly after typing some code in my text editor (which should be picked up by the script). When I was typing, the script was not paused and hotkeys were not suspended.
  2. I selected some text and hit my defined hotkey Ctrl-Shift-C (which is a khook enabled hotkey). This adds the word to a list to be written to a file. The word was NOT written to the file upon exiting my script, so I believe that the hotkey never triggered.

[...pasted code omitted...]

@ManiacDC ManiacDC self-assigned this Oct 30, 2014
@ManiacDC ManiacDC added the bug label Oct 30, 2014
@ManiacDC
Copy link
Owner Author

It turns out this is due to a bug with AHK basic fixed in AHK v1.0.91.01:
http://ahkscript.org/boards/viewtopic.php?f=14&t=4960&p=28850#p28850

Basically, when suspending the hotkeys, AHK basic would uninstall the keyboard hook, even though the main thread was still waiting on the Input command. It should not have been doing this, but worked for my purposes. I didn't run into the situation of the Input breaking because my keyboard hook was regularly re-installed.

The solution is to call Input with no parameters before Suspending the hotkeys, allowing the keyboard hook to uninstall.

@ManiacDC
Copy link
Owner Author

Fixed with v2.19.6.0

@ManiacDC ManiacDC added this to the Released milestone Oct 30, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant