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
This thread will be in archival state beginning 12/31/2015. Please see the main thread here.

TypingAid is a simple, compact, and handy auto-completion utility.

It is customizable enough to be useful for regular typing and for programming.

Download:
TypingAid v2.22.0 Precompiled Executable
TypingAid v2.22.0 AHK Script

As of version 2.19.7.0, the script is no longer compatible with AHK Basic. Please get the newest version from http://www.ahkscript.org.

English Wordlists:
1200 English Words Weighted By Frequency
2000 Common English Words
2000 Common English Words (Alternative)
3600 English Words
Large English Wordlist (Unfiltered, may contain curse words, etc)
Large English Wordlist by rommmcek
Large English Wordlist (words with only 4+ letters) by rommmcek
350,000+ English words (extracted from Project Gutenberg), found here
235,000+ English words (extracted from /usr/share/dict/words), found here

Non-English Wordlists
Large French Wordlist by rommmcek
Large German Wordlist by rommmcek
Large Italian Wordlist by rommmcek
Romanian Wordlist (282,000+ words) Thanks to Ochisor. Extracted from here.
Large Spanish Wordlist by jamesw77bp
Large Spanish Wordlist by rommmcek

AHK Keyword Wordlist:
Wordlist AHK.txt (Thanks tidbit.)
Wordlist AHK with parameter descriptions by rommmcek
Wordlist AHK with parameter descriptions and comments by rommmcek
Wordlist AHK with parameters autocompleted by rommmcek

Screenshots:
TypingAidListBox.png
TypingAidSettings.png

Change Log

Features:
As you type your word, up to 10 (or as defined in Settings) matches will appear in a drop-down dialog, numbered 1 - 0 (10th). To choose the match you want just hit the associated number on your keyboard (numpad does not work). Alternatively you can select an item from the drop-down using the Up/Down arrows or the mouse. You can define a fixed position for the drop-down dialog to appear by hitting Ctrl-Shift-H to open a small helper window, or by specifying a list of programs in the preferences file. Please note that in Firefox, Thunderbird, and certain other programs you will probably need to open the helper window due to issues detecting the caret position.

Words should be stored in a file named 'Wordlist.txt' which should be located in the script directory. These words may be commented out by prefixing with a semicolon or simply removed or added. Words may include terminating characters (such as space), but you must select the word before typing the terminating character.

In addition to being able to use the number keys to select a word, you can select words from the drop-down via the Up/Down arrows. Hitting Up on the first item will bring you to the last and hitting Down on the last item will bring you to the first. Hitting Page Up will bring you up 10 items, or to the first item. Hitting Page Down will bring you down 10 items, or to the last item. You can hit Tab, Right Arrow, Ctrl-Space, or Ctrl-Enter to autocomplete the selected word. This feature can be disabled or have some of its behavior modified via Settings.

The script will learn words as you type them if "Learn new words as you type" is set to On in Settings. If you type a word more than 5 times (or as defined in "Minimum length of word to learn") in a single session the word will be permanently added to the list of learned words. Learned words will always appear below predefined words, but will be ranked and ordered among other learned words based on the frequency you type them. You can permanently learn a word by highlighting a word and hitting Ctrl-Shift-C (this works even if "Learn new words as you type" is set to Off). You may use Ctrl-Shift-Del to remove the currently selected Learned Word.
Learned words are stored in the WordlistLearned.db sqlite3 database. Learned words are backed up in WordlistLearned.txt. To modify the list of Learned words manually, delete the WordlistLearned.db database, then manually edit the WordlistLearned.txt file. On the next launch of the script, the WordlistLearned.db database will be rebuilt.

Word descriptions can be added to 'Wordlist.txt' that will appear in the wordlist next to the word. These descriptions should be in the form of <word>|d|<description>, e.g., Tylenol|d|Pain Reliever. This could be used for things like definitions, translation aids, or function arguments. When Fixed Width fonts are used in the wordlist, the description columns will be tabbed evenly so they line up.

Word replacements can be added to 'Wordlist.txt' that will appear in the wordlist next to the word. These replacements should be in the form of <word>|r|<description>, e.g., fire|r|fuego. When the word is chosen, it will be backspaced out and replaced with the new word. If Case Correction is off, the first letter will be changed to match the case of the word being replaced. This could be used for spelling replacements, text expansion, or translation aids. Multiple replacements can be defined for a word (put each on a separate line).

A description and a replacement can both be added to the same word.

When Settings are changed, the script will automatically create a file named Preferences.ini in the script directory. This file allows for sharing settings between users. Users are encouraged to only edit settings by using the Settings window.
To allow for distribution of standardized preferences, a Defaults.ini may be distributed with the same format as Preferences.ini. If the Defaults.ini is present, this will override the hardcoded defaults in the script. A user may override the Defaults.ini by changing settings in the Settings window.

Customizable features include:
  • Enable or disable learning mode.
  • Number of characters a word needs to have in order to be learned.
  • Number of times you must type a word before it is permanently learned.
  • List of strings which will prevent any word which contains one of these strings from being learned.
  • Number of times you must press a number hotkey to select the associated word.
  • Change whether single or double clicking is required to autocomplete a word with the mouse.
  • Disable certain keys for autocompleting a word selected via the arrow keys.
  • Change the method used to send the word to the screen.
  • Change whether the script simply completes or actually replaces the word (capitalization change based on the wordlist file).
  • Enable or disable the resetting of the Wordlist Box on a mouseclick.
  • Change whether a space should be automatically added after the autocompleted word or not.
  • Number of items to show in the list at once.
  • Number of characters before the list of words appears.
  • Choose whether to display learned words before words in Wordlist.txt.
  • Enable, disable, or customize the arrow key's functionality.
  • Change whether the typed word should appear in the word list or not.
  • Number of pixels below the caret to display the Wordlist Box.
  • Wordlist Box Default Font of fixed (Courier New) or variable (Tahoma) width.
  • Wordlist Box Font Size.
  • Wordlist Box Opacity setting to set the transparency of the List Box.
  • Wordlist Box Character Width to override the computed character width.
  • Wordlist Box Default Font override.
  • Wordlist Box Max Width
  • List of programs for which you want %g_ScriptTitle% enabled.
  • List of programs for which you do not want %g_ScriptTitle% enabled.
  • List of programs for which you want the Helper Window to automatically open.
  • List of characters which terminate a word.
  • List of characters which terminate a word and start a new word.
  • List of characters which end a word, add that character to the word, and force the word to be learned.
Unicode Support:
Full support for UTF-8 character set.

Known Issues

Workarounds

Future Features

Credits:
Maniac
Jordi S
HugoV
kakarukeys
Asaptrad
j4hangir
Theclaw
rommmcek
jamesw77bp



Original Thread

SoLong&Thx4AllTheFish
  • Members
  • 4999 posts
  • Last active:
  • Joined: 27 May 2007
Added to wiki listing below the other two Intellisense scripts <!-- m -->http://www.autohotke... ... ng#Editors<!-- m -->

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

- Pressing del (or ^del) while in tooltip window on selected > word will delete that word/sentence from wordlist.txt

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

Feature suggestion:

- Pressing del (or ^del) while in tooltip window on selected > word will delete that word/sentence from wordlist.txt


I'm not sure that would be a good idea for a few reasons:
A. Couldn't pop up a confirmation without being disruptive - accidental deletes would be hard to recover from.
B. I don't think words will need to be deleted very often, due to that I would prefer the deliberate action of actually being forced to modify the wordlist.txt file directly.

Plus it'd be a bit more of a pain to code since it can't plug directly into the learning code ;).

SoLong&Thx4AllTheFish
  • Members
  • 4999 posts
  • Last active:
  • Joined: 27 May 2007
I still think it could be useful, especially if you frequently mistype words (dyslectics of the world untie) it might get added to the learned words. Of course it is easy to edit the wordslist file but still... perhaps something as "mark for deletion" so the next time the user starts typingaid it will ask are you sure, or when exiting the program, that way it doesn't get in the way as such. Not a huge feature but something that could be added in TA version 7.3 or something :wink:

arsan
  • Members
  • 105 posts
  • Last active: Jan 24 2011 06:54 AM
  • Joined: 02 Jan 2010
This is a useful tool. Thanks.

SoLong&Thx4AllTheFish
  • Members
  • 4999 posts
  • Last active:
  • Joined: 27 May 2007
Some ideas on Known Issues:

[*]If you move the cursor within the same line with the mouse and resume typing, the word will not reset.

Possible solution: Use MouseGetPos to check mouse position, once it moves clear word + tooltip (edit: or perhaps monitor mouseclicks)

[*]The caret position cannot be detected in certain applications, such as FireFox, OpenOffice.org, and Thunderbird. As a workaround for this the drop-down will open at the last position you clicked with your mouse, or you can open a helper window by hitting Ctrl-Shift-H.

Possible solutions:
- would be interesting to see if you indeed could use ACC or COM to get the caret position (see <!-- m -->http://www.autohotke...ic24234-15.html<!-- m --> don't know how ACC/COM works so can't help)
- If caret is 0,0 it means can't get correct value so you could show the helper window automatically (configurable, remember last position so the user doesn't have to move it 'every' time)
- OR still not accurate but closer to the caret position: use ControlGetFocus / ControlGetPos to get the X,Y of the control and either position helper window or the regular tooltip window somewhere in the control with an offset but that probably doesn't help much ...

Edit: Some guy got the caret position to work with firefox he said here <!-- m -->http://www.autohotke...php?t=53639<!-- m --> so there might be hope yet ...

Laszlo
  • Moderators
  • 4713 posts
  • Last active: Mar 31 2012 03:17 AM
  • Joined: 14 Feb 2005
Here is a much simpler typing aid script. Maybe you could combine the ideas.

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

Some ideas on Known Issues:

[*]If you move the cursor within the same line with the mouse and resume typing, the word will not reset.

Possible solution: Use MouseGetPos to check mouse position, once it moves clear word + tooltip (edit: or perhaps monitor mouseclicks)

It's more complicated than that. What if you are in a small edit box and you click to the left of that box on the same line? You may not have changed the cursor position.

One thing I tried was tracking the old horizontal caret position and comparing it, but I ran into several issues with that.

Possible solutions:
- would be interesting to see if you indeed could use ACC or COM to get the caret position (see <!-- m -->http://www.autohotke...ic24234-15.html<!-- m --> don't know how ACC/COM works so can't help)
- If caret is 0,0 it means can't get correct value so you could show the helper window automatically (configurable, remember last position so the user doesn't have to move it 'every' time)
- OR still not accurate but closer to the caret position: use ControlGetFocus / ControlGetPos to get the X,Y of the control and either position helper window or the regular tooltip window somewhere in the control with an offset but that probably doesn't help much ...

Edit: Some guy got the caret position to work with firefox he said here <!-- m -->http://www.autohotke...php?t=53639<!-- m --> so there might be hope yet ...


Thanks, I'll have to look into those at some point. One thing I was hoping to implement was a way to remember the old helper window position (but I haven't tried to figure out how to get the window position when the helper is closed).

Here is a much simpler typing aid script. Maybe you could combine the ideas.

I like the ListBox Gui... that would be ideal to switch to.

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

One thing I was hoping to implement was a way to remember the old helper window position (but I haven't tried to figure out how to get the window position when the helper is closed).

here you go
;Create helper window for showing tooltip
CreateHelperWindow()
{
   Global Helper_id
   IniRead, XY, Preferences.ini, HelperWindow, XY
   StringSplit, Pos, XY, `,
   Gui, Add, Text,,Tooltip appears here
   Gui, Show, X%Pos1% Y%Pos2%
   WinGet, Helper_id, ID,,Tooltip appears here
   WinSet, AlwaysOnTop, On, ahk_id %Helper_id%
   return
}

GuiClose:
SaveHelperWindowPos(Helper_id)
Return

SaveHelperWindowPos(Helper_id)
{
   WinGetPos, hX, hY, , , ahk_id %Helper_id%
   IniWrite, %hX%`,%hY%, Preferences.ini, HelperWindow, XY
   Gui, Hide
}
add this to preferences.ini
[HelperWindow]
XY=200,277
It will remember the position between sessions. If you skip the INI part it will of course remember only per session and you have to make the X & Y pos global.

Do you want me to have a go at the listbox?

Maniac
  • Members
  • 445 posts
  • Last active: Jan 06 2016 12:02 PM
  • Joined: 28 Aug 2009
Hey hugov, thanks. I added the Helper Window position save code with a small modification... I only read the ini file when launching the script and save it when exiting. 2.01 is now uploaded.

Feel free to try the listbox :). I assume you would be planning on simply switching over the "look" from the tooltip to the listbox rather than actually changing any functionality?

Maniac
  • Members
  • 445 posts
  • Last active: Jan 06 2016 12:02 PM
  • Joined: 28 Aug 2009
Also, would people find it useful to be able to increase the minimum length a word must be to learn the word without having to change the number of letters you have to type to pop up the wordlist?

IE at the default settings the script will learn both "come" and "communications", but the autocomplete is obviously much more useful for "communications" than "come".
What do you guys think?

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

Also, would people find it useful to be able to increase the minimum length a word must be to learn the word without having to change the number of letters you have to type to pop up the wordlist?

IE at the default settings the script will learn both "come" and "communications", but the autocomplete is obviously much more useful for "communications" than "come".
What do you guys think?

The idea is to save keystrokes so a simple standard formula:

Length + 2 = new word to be added to the list

Little use to add come to the list if you have set the length variable to 3 but comet would save you 1 keystroke, perhaps another config option :-)

Re listbox: yep same as now. I already made the 'endless scrolling' (cycle) for a listbox a while back <!-- m -->http://www.autohotke...topic31618.html<!-- m -->

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

The idea is to save keystrokes so a simple standard formula:

Length + 2 = new word to be added to the list

Little use to add come to the list if you have set the length variable to 3 but comet would save you 1 keystroke, perhaps another config option :-)

Yeah, that's what I was thinking... length+2 as default, then add a parameter to control it.


Re listbox: yep same as now. I already made the 'endless scrolling' (cycle) for a listbox a while back <!-- m -->http://www.autohotke...topic31618.html<!-- m -->

Sounds good, I just hope it draws as fast as a tooltip or it won't work well enough.

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

Yeah, that's what I was thinking... length+2 as default, then add a parameter to control it.


Done, 2.02 uploaded. You can still force learn a word (ctrl-shift-c), so long as it's longer than "Length".