Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

[AHK 1.1]TypingAid v2.22.0 - Word AutoCompletion Utility


  • Please log in to reply
841 replies to this topic
Maniac
  • Members
  • 445 posts
  • Last active: Jan 06 2016 12:02 PM
  • Joined: 28 Aug 2009
Interesting... 2 works? That's funny because 2 is SendInput, and so is 2C!

No, the Pause simply pauses the script so you can look at variables and things like that, and see where you are in the code; nothing more.

Maniac
  • Members
  • 445 posts
  • Last active: Jan 06 2016 12:02 PM
  • Joined: 28 Aug 2009
So I think I found out what was causing the script to occasionally revert all numbers to hexadecimal... I think the main thread was getting interrupted by a hotkey or something causing the script to never go back to decimal format. I set the thread to critical during that part of the script so it can't be interrupted (and in the OnExit code I force the script back to decimal).

I realized that keys set as hotkeys weren't working when loading/saving the wordlist. I suspended the hotkeys while loading/saving which also changes the icon to show an S and not an H. I think this also makes a good indicator of when the script is loaded.

2.06 is uploaded.


*2.06 02/03/2010
** Hotkeys are now suspended when loading and saving the wordlist. This lets hotkeys be typed while loading/saving and also shows an S rather than an H in the icon when the script is loading/saving.
** Fixed a bug introduced with 2.04 which made it so the tooltip didn't go away after changing windows.
** Hopefully fixed a bug which caused the script to sometimes convert all numbers to hexadecimal, causing the script to malfunction.

lehenryjr
  • Members
  • 65 posts
  • Last active: Nov 22 2013 06:38 PM
  • Joined: 08 Apr 2009
I've the latest revision of the AHK script. It's amazing work BTW.

But could someone explain something for me; I'm having a small issue with the word replacement.

I download'd the wordlist.txt and I'm typing in words like 'alabama' and it's replacing/completing the word as 'aalabama'. It has an extra A at the beginning.

I checked the 'wordlist.txt'; it's fine.

It's like it's just not going back far enough to replace the entire word.

Are there any ideas/suggestions?

-------------
Later,
LEHenryJr.

Maniac
  • Members
  • 445 posts
  • Last active: Jan 06 2016 12:02 PM
  • Joined: 28 Aug 2009
Thanks, glad you like it :)

A. that can happen if you type too fast - it will miss that you typed letters. This would have to happen on the last key you press (or if there are 2 of the same letter in a row). You have to type pretty fast for it to happen.

B. When SciTE4AutoHotkey has been opened and then closed while the script is still open, I've noticed that sometimes not all the backspaces get properly sent (I verified this by creating a variable to track the number of backspaces sent and realized the script was sending the correct number of backspaces, it just was never getting to the program). If you happen to have opened/closed this program while the script is running that could be happening.

lehenryjr
  • Members
  • 65 posts
  • Last active: Nov 22 2013 06:38 PM
  • Joined: 08 Apr 2009
Thanks for the quick reply. I'm continuing my testing and the issue seems to be inconsistent.

a. I'm not typing fast.- wish I could.
b. I'm not doing this while the AHK Script is opening or shutting down.

I'm actually thinking that this could be a symptom of a slow PC?

My experience with AHK and this PC is that the AHK can actually function faster than this PC can deal with it- so of the script is running wide open, perhaps this would explain why some functions/chars are being omitted.

Let me give you another example and let me clarify what I'm doing exactly;

Running the script
opening wordpad
going to the text/edit area
type in 'per' - it gives me 10 suggestions.
I press 1 - it completes fine.
I repeat the process to selection #5.
I choose selection #6 and I get 'PPer...' at the front.


I think the issue is with my PC/system; I'll test on some other machines, but regardless, I think it's amazing what you've done with the scripting language. I was thinking about this very thing just the other day.

Very good work and thanks for the reply.

-------------
Later,
LEHenryJr.

lehenryjr
  • Members
  • 65 posts
  • Last active: Nov 22 2013 06:38 PM
  • Joined: 08 Apr 2009
I've a solution to my [isolated] issue.
In examining the code, and using my idea of the slow PC; I removed your performance section and actually added:

SETKEYDELAY=20

This is proving to provide better results with the script. [on this PC]

My Pc/laptop is a Lenovo and the keyboard drivers are notoriously slow.

Hope this helps.

-------------
Later,
LEHenryJr.

Maniac
  • Members
  • 445 posts
  • Last active: Jan 06 2016 12:02 PM
  • Joined: 28 Aug 2009
Thanks for the info.

What processor does your PC have? I run this on an Atom Z520 @ 1.33 GHz without issue.

b. I'm not doing this while the AHK Script is opening or shutting down.

I'm not referring to the AHK script. Did you use the program 'SciTE4AutoHotkey' at all when using the script? Do you have 'SciTE4AutoHotkey' installed on your PC?

  • Guests
  • Last active:
  • Joined: --
The laptop is a celeron, but it's running McAfee anti-virus, Microsoft outlook, excel and it has hard drive encryption loaded; it drives like a rock wagon. ;)

No, I don't have the 'SciTE4AutoHotkey' installed, nor using it.

Sorry, just found the article, download'd the script and ran it. It worked; I was impressed- I didn't get much further. ;)

Later,
Larry

Maniac
  • Members
  • 445 posts
  • Last active: Jan 06 2016 12:02 PM
  • Joined: 28 Aug 2009
Celeron at what speed? Celeron ranges from 400 mhz to 2+ GHz :). Really I can't see a slow system being too bogged down by this if my Atom can handle it. A sub 1 GHz celeron definitely might have problems though.

Just trying to find the root of the problem :), thanks for you responses.

Other things you can do is try messing with the send method in the preferences file... see if send method #2 works better for you.

I might look more into SetKeyDelay, I never tried playing with it.

lehenryjr
  • Members
  • 65 posts
  • Last active: Nov 22 2013 06:38 PM
  • Joined: 08 Apr 2009
It's a Celeron 2ghz with 1g memory; it's a work machine and it's bogged down with security and hard drive encryption and anti-virus crap; it's a wonder I get anything done.. ;)

On my work machine, and the AHK scripts I've used the pasting whole words method works better than the sending letters one at a time. So, I'll look in to the #2 options.

I've to use SETKEYDELAY to at least 20 or my machine starts dropping chars when it's pasting and moving and doing what I script it to do. I seriously think it's a POS, but it's for work.. so..

Thanks again.

Later,
Larry

Maniac
  • Members
  • 445 posts
  • Last active: Jan 06 2016 12:02 PM
  • Joined: 28 Aug 2009
Hmm, that should still be faster than my Atom. Security and HDD encryption software should mainly only matter when reading/writing to disk.

The paste options (1C-4C) can't send backspaces via the clipboard (they are sent normally) so it may not help.

Maniac
  • Members
  • 445 posts
  • Last active: Jan 06 2016 12:02 PM
  • Joined: 28 Aug 2009
See this in the help file for SetKeyDelay:

Although this typically causes keystrokes to be sent faster than the active window can process them, the system automatically buffers them. Buffered keystrokes continue to arrive in the target window after the Send command completes (even if the window is no longer active). This is usually harmless because any subsequent keystrokes sent to the same window get queued up behind the ones already in the buffer.

Either that doesn't apply to SendPlay (SendMethod #1), or that's not your underlying issue and just happens to work around whatever is actually causing the issue.

edit -
also interesting, SetKeyDelay should not be doing anything at all for SendMethod=1 as SetKeyDelay needs the Play parameter passed in to do anything at all.

Also, you said you added:
SETKEYDELAY=20
isn't the proper syntax:
SETKEYDELAY,20
Does the "=" operator even work? I've never tried it.

kakarukeys
  • Members
  • 86 posts
  • Last active: Jul 18 2010 03:10 PM
  • Joined: 28 Sep 2009
:) I guess I miss the activities here. Busy with a paper.

@maniac
Good to see the script improved.
I had some issue with Ctrl+Shift+C, but it seems in 2.06 it works fine.
Now testing with Unicode-AHK, the script worked fine with Russian and Bosnian languages, but I'm not on a native keyboard. I've created wordlist in Russian language for testing. After I am done with the paper, I will post everything.

Could you tell me briefly, besides the word/phrase length limit what other limitation is there in 2.x that wasn't in 1.x?

@hugov
I have some suggestions regarding caret detection in firefox and other difficult programs. You seem to be using GetCaretPos that doesn't work.

AHK uses win32 api's GetCaretPos to obtain caret position, before using the function, it attaches input between the script thread and the foreground window's thread. Check the AHK source code for more details.

possible solution for Firefox:
(1) XPCOM automation which works on all Mozilla software.
(2) ACC as you have mentioned.
I doubt COM will work.
(3) ImageSearch: I can get 100% detection accuracy, but it's pointless, since one has to create different image files for different programs on different OS's. Some Microsoft IME might have used similar technique from my observation. Google IME seems different, I have no idea how Google IME could detect caret accurately in Firefox/Openoffice writer. Unfortunately it's not open-source.
(4) using Last-mouse-click position + helper window as a failsafe is by far the best workaround
TypingAid autocompletion program made with AHK.

SoLong&Thx4AllTheFish
  • Members
  • 4999 posts
  • Last active:
  • Joined: 27 May 2007

AHK uses win32 api's GetCaretPos to obtain caret position, before using the function, it attaches input between the script thread and the foreground window's thread. Check the AHK source code for more details.

Not likely as I don't know C++ nor care to learn about it.

possible solution for Firefox:
(1) XPCOM
(2) ACC
(3) ImageSearch
(4) using Last-mouse-click position + helper window

ACC would be the only method as there is acc.ahk noone will develop XPCOM or something else. If you find a solution post it, I'm sure I won't be able to find it ...

Maniac
  • Members
  • 445 posts
  • Last active: Jan 06 2016 12:02 PM
  • Joined: 28 Aug 2009

:) I guess I miss the activities here. Busy with a paper.

Good luck with the paper :)

@maniac
Good to see the script improved.
I had some issue with Ctrl+Shift+C, but it seems in 2.06 it works fine.
Now testing with Unicode-AHK, the script worked fine with Russian and Bosnian languages, but I'm not on a native keyboard. I've created wordlist in Russian language for testing. After I am done with the paper, I will post everything.

Could you tell me briefly, besides the word/phrase length limit what other limitation is there in 2.x that wasn't in 1.x?

Interesting... I don't recall changing any code that would affect Ctrl-Shift-C, lol.

Also, as you may have noticed, when using the non-unicode version, the length limit has increased to 123 characters.

Please see this post regarding SendMethod and the various limitations (documentation in the Preferences.ini file):
<!-- m -->http://www.autohotke... ... 369#328369<!-- m -->

Besides that there are no limitations that have changed from 1.x that I am aware of.

Also, Unicode AHK has merged with AutoHotKey_L (http://www.autohotke...t=50485&start=0). You may want to check that everything still works.