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
kakarukeys
  • Members
  • 86 posts
  • Last active: Jul 18 2010 03:10 PM
  • Joined: 28 Sep 2009

Why can't the script detect chinese characters? Do they hit multiple characters to print a single one like in Japanese (like how it converts hiragana to kanji)?


Yes. Average number of keys to output one char is 3, depending on the IME.

new issues (not sure if they are bugs)
1. can't seem to detect Enter and Backspace in Win7 Sticky Notes
(try autocomplete a phrase, then press enter, then try to type the same phrase again)

2. when Length = 2, sometimes the program can't detect keys well, tooltip doesn't show up when it should, typing a word more than 5 times is needed to learn it. probably an inevitable limitation due to the hashing?


still a distance away from mass release.
TypingAid autocompletion program made with AHK.

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

Yes. Average number of keys to output one char is 3, depending on the IME.

new issues (not sure if they are bugs)
1. can't seem to detect Enter and Backspace in Win7 Sticky Notes
(try autocomplete a phrase, then press enter, then try to type the same phrase again)

2. when Length = 2, sometimes the program can't detect keys well, tooltip doesn't show up when it should, typing a word more than 5 times is needed to learn it. probably an inevitable limitation due to the hashing?


still a distance away from mass release.


Yeah, not sure how to handle the Chinese one then. What characters *does* it detect? Is it possible to have the non-transformed word in your wordlist, so as you type it you autocomplete that one, and then when the program sends it it gets transformed?

(edit: actually I think that would mess up the backspaces)


1. I'll try testing that on my Win7 machine... is that a gadget? Does 1.x work?

2. What size wordlist are you using? I wouldn't recommend using Length 2 on any wordlists that are too big, especially on a slow pc. I can test it though....

edit for #2: It all works fine for me - both the tooltip and the learning... are you sure the word is not getting learned? If you have a big list of words it will take a long time for it to get into the first 10-20 words. Learned Words by default start at the bottom of the list. It would be best to type the word 5x, then exit the program and see if it appears in your physical wordlist - if it is then you are all set.

edit:
I updated the first post with all known issues I have verified.

kakarukeys
  • Members
  • 86 posts
  • Last active: Jul 18 2010 03:10 PM
  • Joined: 28 Sep 2009

Yeah, not sure how to handle the Chinese one then. What characters *does* it detect? Is it possible to have the non-transformed word in your wordlist, so as you type it you autocomplete that one, and then when the program sends it it gets transformed?


I thought the AHK command is able to capture the unicode character or its numeric code and not the keys that constituted it. No? Because different IMEs will have totally different key combinations that generate a character.

e.g. 'feng' is used to input the character 丰 in the most popular IME, but 'qj' is used in a lesser one.

in most IMEs, after you key in the characters, you need to select a correct word from a list using number keys and that ordering is subject to change due to some smart algorithm that moves a popular word upward, so what you suggested won't work.

1. I'll try testing that on my Win7 machine... is that a gadget? Does 1.x work?


not a gadget, but a default software that comes with win7. 1.x does work.
I remembered saying something similar 2 days ago. :D could the history repeat itself?

2. What size wordlist are you using? I wouldn't recommend using Length 2 on any wordlists that are too big, especially on a slow pc. I can test it though....

edit for #2: It all works fine for me - both the tooltip and the learning... are you sure the word is not getting learned? If you have a big list of words it will take a long time for it to get into the first 10-20 words. Learned Words by default start at the bottom of the list. It would be best to type the word 5x, then exit the program and see if it appears in your physical wordlist - if it is then you are all set.


A small wordlist containing 6 phrases. But it's a slow, because it's on VirtualBox. hmmm.... Could this be the reason? Yes as I typed the 2nd time, a tooltip started to show, and in the 3rd, 4th, 5th, sometimes the tooltip did not show, then the word did not get learned.


SendMethod=1 is unable to send characters which do not exist on your keyboard layout. Try switching to a different SendMethod in the Preferences.ini file if you find that you are unable to autocomplete certain characters.


I was able to send out ô, Ô with SendMethod 1 (in EN US keyboard layout) contrary to what AHK documentation claimed. But I faced the same problem as described by a user in page 2 or 3, i.e. it totally cannot send out any characters on my win7. So i switched to SendMethod=2 at the moment, and it should be made default, if there isn't a problem. So far so good, SendMethod=2 is the send method used in 1.x
TypingAid autocompletion program made with AHK.

Maniac
  • Members
  • 445 posts
  • Last active: Jan 06 2016 12:02 PM
  • Joined: 28 Aug 2009
I don't know enough about how AHK interacts with IME. It depends how the Input command catches the characters. You can set up a variable right after the input command that looks like the following:

aTrackChr .= "," . chr

Then after you type a few characters and choose the generated character, Open the AHK Window and look at the variable in the variable list. See if what you originally typed is in the list or if the generated character is there.


not a gadget, but a default software that comes with win7. 1.x does work.
I remembered saying something similar 2 days ago. could the history repeat itself?


I don't know why it wouldn't work, I'll check it out.

A small wordlist containing 6 phrases. But it's a slow, because it's on VirtualBox. hmmm.... Could this be the reason? Yes as I typed the 2nd time, a tooltip started to show, and in the 3rd, 4th, 5th, sometimes the tooltip did not show, then the word did not get learned.


I tried it on my PC with the 100,000 word list and I didn't have any more problems. I don't know why you are having issues. Please try typing very slowly to see if that alleviates the issue. Also I'd try it in native windows, not in a VM (although when I know it works fine in Windows Virtual PC, as I've used it there for testing).

I was able to send out ô, Ô with SendMethod 1 (in EN US keyboard layout) contrary to what AHK documentation claimed. But I faced the same problem as described by a user in page 2 or 3, i.e. it totally cannot send out any characters on my win7. So i switched to SendMethod=2 at the moment, and it should be made default, if there isn't a problem. So far so good, SendMethod=2 is the send method used in 1.x

I've had issues with both SendMethod 1 & 2 not sending characters not on my keyboard layout for some reason. 3 is the most reliable but doesn't buffer keys and is slow (and there are a few potential issue scenarios that are untested with 3). Probably the most reliable method would be one of the copy/paste methods.
Also, SendMethod 3 is what's used in the early versions of 1.X, not SendMethod 2.

There are actually more big issues with SendMethod 2... it uses SendInput which has a bug which prevents it from buffering keys. Pick a really long word (like 20 characters), and hit the button to AutoComplete it. Immediately afterwards (like, almost in perfect sync... it's best to try hitting the buttons at the same time), hit any key which prints a character or affects the output... like a letter or the shift key. You'll notice that your key press is interspersed when it's not supposed to be. This is a big issue with the shift key.

I think SendMethod 1 (SendPlay) is only going to have problems for people who are running other programs which do weird things with the keyboard. Most people shouldn't have any issues with it.

edit:
I played some with SetKeyDelay... When in SendMethod 3 setting it to 0 or -1 allows keys to be interspersed (even though I have BlockInput,Send set), but not when it's set to 1 or higher... interesting. This seems to be related to the SendInput bug.

edit2:
I think SendMethod 1 is one reason we are having problems with backspaces as well. I wonder if we should make 2C, 3C, or 4C one of the dft methods (1C has the backspace issue too)? I would take a guess that most people aren't using programs that keep track of their clipboard.

edit3:
Scratch that, waiting for data in the clipboard seems pretty unreliable. I'm having issues with it sending the data previously in the clipboard with some of the methods.

edit4:
So for reliability I'm wondering if we should make SendMethod=3 default then? It would need some testing to make sure everything works ok (especially when hitting hotkeys but not autocompleting them). It has no key buffering, and is slow, but at least doesn't allow interspersion and seems to address the backspace bug.

kakarukeys
  • Members
  • 86 posts
  • Last active: Jul 18 2010 03:10 PM
  • Joined: 28 Sep 2009

I don't know enough about how AHK interacts with IME. It depends how the Input command catches the characters. You can set up a variable right after the input command that looks like the following:

aTrackChr .= "," . chr

Then after you type a few characters and choose the generated character, Open the AHK Window and look at the variable in the variable list. See if what you originally typed is in the list or if the generated character is there.


Doing some study here. Checking with Spy++, and my wordpad gets WM_CHAR notification chCharCode:'00E9' (233), after I input è. That's what I'm looking for. The WM_CHAR message uses Unicode Transformation Format (UTF)-16 according to MSDN. I was hoping I would get something similar when I input Chinese char 豐, i.e. I hoped I could get the final output character, but there was none.

<05094> 000D053A P WM_KEYUP nVirtKey:VK_SPACE cRepeat:1 ScanCode:39 fExtended:0 fAltDown:0 fRepeat:1 fUp:1
<05095> 000D053A P WM_PAINT hdc:00000000
<05096> 000D053A S WM_NCPAINT hrgn:12040C6F
<05097> 000D053A R WM_NCPAINT
<05098> 000D053A S WM_ERASEBKGND hdc:9F010DAE
<05099> 000D053A R WM_ERASEBKGND fErased:True
<05100> 000D053A S WM_GETTEXTLENGTH
<05101> 000D053A R WM_GETTEXTLENGTH cch:1


Will investigate further and try out your code.

I tried it on my PC with the 100,000 word list and I didn't have any more problems. I don't know why you are having issues. Please try typing very slowly to see if that alleviates the issue. Also I'd try it in native windows, not in a VM (although when I know it works fine in Windows Virtual PC, as I've used it there for testing).


Will find one to test.

I've had issues with both SendMethod 1 & 2 not sending characters not on my keyboard layout for some reason. 3 is the most reliable but doesn't buffer keys and is slow (and there are a few potential issue scenarios that are untested with 3). Probably the most reliable method would be one of the copy/paste methods.
Also, SendMethod 3 is what's used in the early versions of 1.X, not SendMethod 2.

There are actually more big issues with SendMethod 2... it uses SendInput which has a bug which prevents it from buffering keys. Pick a really long word (like 20 characters), and hit the button to AutoComplete it. Immediately afterwards (like, almost in perfect sync... it's best to try hitting the buttons at the same time), hit any key which prints a character or affects the output... like a letter or the shift key. You'll notice that your key press is interspersed when it's not supposed to be. This is a big issue with the shift key.

I think SendMethod 1 (SendPlay) is only going to have problems for people who are running other programs which do weird things with the keyboard. Most people shouldn't have any issues with it.

edit:
I played some with SetKeyDelay... When in SendMethod 3 setting it to 0 or -1 allows keys to be interspersed (even though I have BlockInput,Send set), but not when it's set to 1 or higher... interesting. This seems to be related to the SendInput bug.

edit2:
I think SendMethod 1 is one reason we are having problems with backspaces as well. I wonder if we should make 2C, 3C, or 4C one of the dft methods (1C has the backspace issue too)? I would take a guess that most people aren't using programs that keep track of their clipboard.

edit3:
Scratch that, waiting for data in the clipboard seems pretty unreliable. I'm having issues with it sending the data previously in the clipboard with some of the methods.

edit4:
So for reliability I'm wondering if we should make SendMethod=3 default then? It would need some testing to make sure everything works ok (especially when hitting hotkeys but not autocompleting them). It has no key buffering, and is slow, but at least doesn't allow interspersion and seems to address the backspace bug.


hmmm... I think you did a more extensive study than me here. So I think I will stop messing around :D In your opinion, which one should be the default? I checked some of our competitor software, if they have clipboard method, they set it as an option and not using it as default. There must be some reason behind. So let's pick one method from (1,2,3).
TypingAid autocompletion program made with AHK.

Maniac
  • Members
  • 445 posts
  • Last active: Jan 06 2016 12:02 PM
  • Joined: 28 Aug 2009
For me personally, SendMethod=3 is wayyy too slow. I type fast and I find it excruciatingly slow. I think unless there are a lot of complaints, then SendMethod=1 should be default, with a note in the readme. SendMethod=2 has too many interspersion problems for my taste.

But the end user may not mind the slow output of SendMethod=3....

Maniac
  • Members
  • 445 posts
  • Last active: Jan 06 2016 12:02 PM
  • Joined: 28 Aug 2009
OK, I can confirm Win Vista x64 works just fine, at least with UAC disabled.

I can also confirm that there do seem to be some problems with Win 7 Sticky notes. It seems the script lags up at times in the Sticky notes (even though the CPU usage is not going high). I would say that it's something odd about the sticky notes. It seemed to miss a lot of keys. Kakarukeys, I have an idea... can you test something for me?

Open a helper window while sticky notes is open, make sure it is not on top of the sticky notes at all. Then try typing and see if the issue occurs.

kakarukeys
  • Members
  • 86 posts
  • Last active: Jul 18 2010 03:10 PM
  • Joined: 28 Sep 2009
so be it :)

I can also confirm that there do seem to be some problems with Win 7 Sticky notes. It seems the script lags up at times in the Sticky notes (even though the CPU usage is not going high). I would say that it's something odd about the sticky notes. It seemed to miss a lot of keys. Kakarukeys, I have an idea... can you test something for me?

Open a helper window while sticky notes is open, make sure it is not on top of the sticky notes at all. Then try typing and see if the issue occurs.



There is no problem with helper window on! Strange. Is that a drawing/redrawing issue? But 1.x worked fine.
TypingAid autocompletion program made with AHK.

kli6891
  • Members
  • 46 posts
  • Last active: Nov 24 2012 08:12 PM
  • Joined: 01 Aug 2009
One suggestion:

If the initial letter of a word is capitalized, then its replacement should be capitalized also.

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

so be it :)

There is no problem with helper window on! Strange. Is that a drawing/redrawing issue? But 1.x worked fine.


Yes, I noticed that too, I wanted you to confirm it. It seems to be a drawing issue. Can you re-test 1.x to verify that it works fine? Because it seemed at times that 2.x worked fine for me too - it was very inconsistent.

I wonder if it has to do with the height of the sticky note? It seems to work more smoothly when it's taller.

One suggestion:

If the initial letter of a word is capitalized, then its replacement should be capitalized also.

Hi Kli, currently it's purposely setup to correct capitalization (necessary for many programming languages). It does learn capitalized words separately from non-capitalized words. Maybe I can make that an optional parameter.

Maniac
  • Members
  • 445 posts
  • Last active: Jan 06 2016 12:02 PM
  • Joined: 28 Aug 2009
OK, I found several sending bugs with AHK:

1. When using SendMethod 1 or 1C (SendPlay) to autocomplete words like 10 characters or less, the first key press is sometimes not sent (this is a backspace). This causes the first letter to not be removed. This seems to occur more often on some machines than others.

2. When using SendMethod 1,2,1C,2C (SendPlay/SendInput); the Ctrl key from Ctrl-Space and Ctrl-Enter sometimes interact with the sending text (so if you autocomplete the word "amazing"; Ctrl-a, Ctrl-m, Ctrl-a, Ctrl-z, Ctrl-i, Ctrl-n, Ctrl-g will be sent to the program. This seems to be related to a certain set of circumstances on the PC the program is running on as I can't reproduce it now.

I haven't been able to reproduce either of the above in a standalone program.


v2.09 includes a workaround for #1, I send several Shift key presses before sending the backspaces. #2 is unaddressed.

*2.09
** Added the Right Arrow key as an AutoComplete key
** Added a workaround for an AHK bug which prevented the first backspace from occasionally being sent when SendMethod=1 or 1C.
** Added a fix for an issues which caused "v" to be sent occasionally when SendMethod=4C.
** Added more safeguards to prevent the issue noted in 2.06 with hexadecimal numbers. The error still occured occasionally.

kakarukeys
  • Members
  • 86 posts
  • Last active: Jul 18 2010 03:10 PM
  • Joined: 28 Sep 2009

so be it :)

There is no problem with helper window on! Strange. Is that a drawing/redrawing issue? But 1.x worked fine.


Yes, I noticed that too, I wanted you to confirm it. It seems to be a drawing issue. Can you re-test 1.x to verify that it works fine? Because it seemed at times that 2.x worked fine for me too - it was very inconsistent.

I wonder if it has to do with the height of the sticky note? It seems to work more smoothly when it's taller.


On 2nd test, 1.x works fine also. I think it has nothing to do with the height. The problem seems to be on and off all the time.
TypingAid autocompletion program made with AHK.

kakarukeys
  • Members
  • 86 posts
  • Last active: Jul 18 2010 03:10 PM
  • Joined: 28 Sep 2009

2. When using SendMethod 1,2,1C,2C (SendPlay/SendInput); the Ctrl key from Ctrl-Space and Ctrl-Enter sometimes interact with the sending text (so if you autocomplete the word "amazing"; Ctrl-a, Ctrl-m, Ctrl-a, Ctrl-z, Ctrl-i, Ctrl-n, Ctrl-g will be sent to the program. This seems to be related to a certain set of circumstances on the PC the program is running on as I can't reproduce it now.


If this is serious, i think we can just remove Ctrl+Space and Ctrl+Enter. I'm afraid the no. of bugs is escalating due to addition of new features. Let the keys be (Tab, Enter, Right Arrow) with Enter disabled in the default preference. How about that?
TypingAid autocompletion program made with AHK.

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

If this is serious, i think we can just remove Ctrl+Space and Ctrl+Enter. I'm afraid the no. of bugs is escalating due to addition of new features. Let the keys be (Tab, Enter, Right Arrow) with Enter disabled in the default preference. How about that?


It is pretty serious, but I haven't been able to replicate it again. I think it has something to do with running multiple scripts or more likely the fact I had SCiTE4AHK open (this program seems to mess with the Send methods pretty badly, it also causes problems in other apps... IE double clicking the title bar in a window does not restore/maximize it, Ctrl-1-Ctrl-0 doesn't work in TextPad when it's open, etc). I removed this off the known issues until I get some more solid confirmation of it.

If it does get confirmed, I think what we could just disable Ctrl-Enter/Ctrl-Space when SendMethod 1/2 is used and make a note of this in the preferences.

I could allow Enter as an AutoComplete key, disabled by default I guess.

Thanks

On 2nd test, 1.x works fine also. I think it has nothing to do with the height. The problem seems to be on and off all the time.

I'll play with it some more this weekend I guess. I don't know if there'll be anything I can do about it.

kakarukeys
  • Members
  • 86 posts
  • Last active: Jul 18 2010 03:10 PM
  • Joined: 28 Sep 2009

2. when Length = 2, sometimes the program can't detect keys well, tooltip doesn't show up when it should, typing a word more than 5 times is needed to learn it. probably an inevitable limitation due to the hashing?


Latest Update: test on VirtualBox Win7 shows the problem exists for Length = 2 and 3, but only on NotePad.

test on native Win7 is fine. So I guess it has something to do with virtualization, not a real bug.
TypingAid autocompletion program made with AHK.