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

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 ...


Me too. I'm a Python programmer, not so skilled in C++. I stopped tackling this problem after realizing my limitation. Post a message here, hopefully someone else can find it from the Search.

forgot to add
(5) I noticed Firefox uses WM_PAINT to draw/redraw its window, perhaps when the caret is blinking , it's possible to hook BeginPaint function, and check the rcPaint parameter in the output. It may reveal the caret coordinates.
TypingAid autocompletion program made with AHK.

lehenryjr
  • Members
  • 65 posts
  • Last active: Nov 22 2013 06:38 PM
  • Joined: 08 Apr 2009
@maniac
Your right, the correct syntax is 'setkeydelay, 20' is correct. I just typed it wrong.

Interesting, the change that I made shouldn't be doing anything...
I'm not in your league of development, but after I made the change I received better results.

I appreciate it...

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

testing and writing a quick guide now. The intro on the first post is meant for geeks, I'm writing one for laymen. I have also released TypingAid 1.3 (the final update for 1.x with the helper window feature) while testing and packaging TypingAid 2.06

AutoHotKey_L works, but still has an issue, same as AutoHotKey_U which I shall avoid mentioning at this moment so as not to confuse.

missed key bug is rarer now, at an acceptable level. but Ctrl + Shift + C is problematic again.

Could you clarify, is it supposed to learn any phrase (within the length limit) which is true in 1.x or just word?

below are the phrases that cannot be learned:

wordlist.txt", save it
window, tooltip


I didn't put anything in
ForceNewWordCharacters=

also you mentioned in one of the updates, that ForceNewWordCharacters won't affect Ctrl + Shift + C. The intro hasn't been updated to reflect this, it still says if a word has chars in ForceNewWordCharacters it cannot be added to wordlist with Ctrl + Shift + C
TypingAid autocompletion program made with AHK.

Maniac
  • Members
  • 445 posts
  • Last active: Jan 06 2016 12:02 PM
  • Joined: 28 Aug 2009
OHHH, I see the issue. As I said, when I designed this it was never intended for phrases. There is a list that is stored that keeps track of learned words. This list just happens to use a comma delimiter! Maybe I should change the character to something less common, such as |, ||, or something.

Thanks, I'll fix the first post.

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

OHHH, I see the issue. As I said, when I designed this it was never intended for phrases. There is a list that is stored that keeps track of learned words. This list just happens to use a comma delimiter! Maybe I should change the character to something less common, such as |, ||, or something.

Thanks, I'll fix the first post.


I see. Is it possible to use character not on the keyboard? it's good to pick one obsolete ascii characters from 0~31 in the table as the delimiter.
TypingAid autocompletion program made with AHK.

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

OHHH, I see the issue. As I said, when I designed this it was never intended for phrases. There is a list that is stored that keeps track of learned words. This list just happens to use a comma delimiter! Maybe I should change the character to something less common, such as |, ||, or something.

Thanks, I'll fix the first post.


I see. Is it possible to use character not on the keyboard? it's good to pick one obsolete ascii characters from 0~31 in the table as the delimiter.


Yep, I was able to use Ascii 2 (STX - Start of Text), thanks for the suggestion.

*2.07 02/08/2010
** Fixed a bug which prevented phrases with commas from being learned when hitting Ctrl-Shift-C or when comma was not a terminating character.

kakarukeys
  • Members
  • 86 posts
  • Last active: Jul 18 2010 03:10 PM
  • Joined: 28 Sep 2009
on-going testing:
A list of all bugs in descending order of criticality

1. length limit no exception handling when LearnMode = Off (critical)

I just checked the length limit exists when LearnMode = Off. There is no exception handling, so an error message pops up when trying to autocomplete a over-long phrase.

2. whitespace after phrase is ignored during autocompletion. (critical)

3. Old bug existed since 1.x: in certain keyboard layouts where dead keys like `" are used to type accented characters. User might encounter problems typing the dead key itself by typing [dead key] followed by [space], an extra character could be sent out which might affect the next character.

4. tooltip displays above caret even if there is enough room below, though outside of the active window.

5. on native Spanish keyboard, can't type áéíóú when program is running - anyone who has native Spanish keyboard to try out?

6. Occasionally the program might fail to delete one or two characters during autocompletion (missed key problem, at acceptable level).

7. Can't read wordlist.txt in Vista64bits - work in Win7-64bits (UAC Off) - this is doubtful, anyone has Vista64bits to try out?
TypingAid autocompletion program made with AHK.

kakarukeys
  • Members
  • 86 posts
  • Last active: Jul 18 2010 03:10 PM
  • Joined: 28 Sep 2009
A list of all bugs in descending order of criticality affecting Unicode version only

1. ForceLearn will cause wordlist to be converted to ANSI format, and lose chars (critical)

2. AutoLearn will cause wordlist to be converted to ANSI format, and lose chars (critical)

3. Can't detect Chinese characters (HARD)

4. chars are garbled when sending out Chinese characters.

5. extra chars are sent out when sending out Chinese characters

It's probably not possible to fix all in one or two months, so let's fix the most critical fews and I shall make a release on my site.
TypingAid autocompletion program made with AHK.

SoLong&Thx4AllTheFish
  • Members
  • 4999 posts
  • Last active:
  • Joined: 27 May 2007
Re ANSI format have a look at <!-- m -->http://www.autohotke... ... _IsUnicode<!-- m --> so you can determine which version is running and set the file format (utf) accordingly

Maniac
  • Members
  • 445 posts
  • Last active: Jan 06 2016 12:02 PM
  • Joined: 28 Aug 2009
OK, for non-unicode:
1. Interesting, I don't think there should be a max length. I'll figure out why this is happening.

2. Could you clarify this? Do you mean if you put in a phrase that has spaces after it in the wordlist file?
If so, sorry, I don't think that one is going to change. That's a side-effect of AutoTrim, On and works like that in 1.X as well.

3. So are you saying that when ` and " are not in your TerminatingCharacters list, and you type either of them and then hit space, the program is sending an extra character?

4. That's mainly due to the possibility of multiple monitors. The Caret function returns the caret's position within the current window. To make it take into account desktop size I'd have to figure out which monitor they are typing on, and where within each monitor they are typing. Then there is the question of what happens if they are between two monitors. I think most Windows users are going to have their programs maximized. If this were for a Mac it might be an issue, but I don't think it's a problem on Windows.

6. I'm not sure if this is due to the script not registering keystrokes or due to AHK not sending all the backspaces I'm telling it to send. I've seen both issues.

7. I have a Vista 64 bit machine, I'll have to try it later today. IIRC this worked fine on my current machine on Vista 64 before I reformatted to Win 7 64.

Re Unicode:
I'll check out the FileFormat thing, I thought Unicode AHK was supposed to set it automatically but maybe not.

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

OK, for non-unicode:
2. Could you clarify this? Do you mean if you put in a phrase that has spaces after it in the wordlist file?
If so, sorry, I don't think that one is going to change. That's a side-effect of AutoTrim, On and works like that in 1.X as well.


Yes. phrase like "Curiosity killed the cat. ". That's strange, 1.x does output the spaces.

3. So are you saying that when ` and " are not in your TerminatingCharacters list, and you type either of them and then hit space, the program is sending an extra character?


clarification:
here's what happen:

without TypingAid (correct behaviour):
'a=á
'{SPACE}a=´a

with TypingAid, when ' is in TerminatingCharacters:
'a=a
'{SPACE}a=´a

with TypingAid, when ' is not in TerminatingCharacters:
'a=á
'{SPACE}a=´á
TypingAid autocompletion program made with AHK.

Maniac
  • Members
  • 445 posts
  • Last active: Jan 06 2016 12:02 PM
  • Joined: 28 Aug 2009
1. I have a fix for this, I'll upload it soon.

2. You are right, it does work in 1.X, but it's working for me in 2.X as well. Your example "Curiosity killed the cat. " works fine (in fact I just autocompleted it :D).

3. I'll check this out, it may have to do with the sendmethod.

4. I thought up some logic for this:
If Window is Maximized
{
Use Current Method
} else {
If Window is fully contained in a single monitor, show tooltip if there is room in that one monitor (requires some math to get caret position relative to monitor rather than window)
} else {
Use Current Method
}

Maniac
  • Members
  • 445 posts
  • Last active: Jan 06 2016 12:02 PM
  • Joined: 28 Aug 2009
3. OK, when ' is in terminatingcharacters this appears to be an AHK bug. Input has "V" set so the character should be printing back. I am getting an ASCII 233 è from the Input when `e is hit, but the Input command is sending e to the program. It should properly bring up words for auto-completion, but if you don't auto-complete the word the regular e only will show up.

I have no idea what's happening when ` is not in terminating characters. The only thing reaching the Input command is the letter I type.


I have zero motivation to fix or address said issues for #3, so I'll leave that to someone else to deal with if they want to.

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

2. You are right, it does work in 1.X, but it's working for me in 2.X as well. Your example "Curiosity killed the cat. " works fine (in fact I just autocompleted it :D).


:lol: It was me, I added some custom code.

4. I thought up some logic for this:
If Window is Maximized
{
Use Current Method
} else {
If Window is fully contained in a single monitor, show tooltip if there is room in that one monitor (requires some math to get caret position relative to monitor rather than window)
} else {
Use Current Method
}


Sounds complicated, not a critical issue, if too difficult to do, can leave as is...

issue #3, ya, probably an AHK bug, I think I will isolate the problematic statement and send a bug report some time.
TypingAid autocompletion program made with AHK.

Maniac
  • Members
  • 445 posts
  • Last active: Jan 06 2016 12:02 PM
  • Joined: 28 Aug 2009
OK, 2.08 is up. Fixes 1 For non-unicode issues, fixes 1 & 2 for unicode issues.

*2.08
** Fixed a bug which caused the script to error when a word was too long when LearnMode=Off.
** Fixed a bug which caused the script to remove unicode characters from learned words when saving the wordlist in unicode mode.


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)?