AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TypingAid v2.16b - Word AutoCompletion Utility
Goto page Previous  1, 2, 3 ... 8, 9, 10 ... 30, 31, 32  Next
 
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
maniac



Joined: 28 Aug 2009
Posts: 267

PostPosted: Wed Mar 10, 2010 9:46 pm    Post subject: Reply with quote

I think to reduce confusion we should do one list for include/exclude. Otherwise it seems a little silly

Code:
[Programs]
Type=Include
Title=Notepad|Wordpad

[Helperwin]
Title=Firefox|Thunderbird



I guess that would work.


I'll change the Gui to Gui, +Owner. Thanks!
Back to top
View user's profile Send private message
ponzonik
Guest





PostPosted: Thu Mar 11, 2010 2:17 am    Post subject: Reply with quote

I have a question. ~RButton conflicts with other scripts when #including. So, what does this

Code:

~RButton::
;If we aren't using the DetectMouseClickMoveScheme, skip out
IfNotEqual, DetectMouseClickMove, On
   Return
   
; If we have a Word and an OldCaretX, check to see if the Caret moved
IfNotEqual, OldCaretX,
{
   IfNotEqual, Word,
   {
      KeyWait, RButton, U
      ; Using GoSub as A_CaretX in function call breaks doubleclick
      GoSub, CheckForCaretMove
   }
}

Return
code section do?

Thanks!
Back to top
maniac



Joined: 28 Aug 2009
Posts: 267

PostPosted: Thu Mar 11, 2010 2:53 am    Post subject: Reply with quote

It just checks to make see if the caret has moved after a right click. If it has it resets the tooltip.
Back to top
View user's profile Send private message
maniac



Joined: 28 Aug 2009
Posts: 267

PostPosted: Thu Mar 11, 2010 12:03 pm    Post subject: Reply with quote

LOL I noticed something silly about my change in 2.12... if you try to move the Helper Window now when you have a Title set, you can't! It hides the Tooltip when you try to move it =.=. I'll fix that in the next version.
Back to top
View user's profile Send private message
maniac



Joined: 28 Aug 2009
Posts: 267

PostPosted: Thu Mar 18, 2010 4:05 pm    Post subject: Reply with quote

kakarukeys posted a nice 36,000 frequency-based wordlist here:
http://www.artwinauto.com/time-saving-guides/typing-and-programming/english-frequency-word-list-for-typingaid.html

Technically after a long time typing, TypingAid would to that for you (if they were under Learned words), but it would take a LONG time (and the feature is actually broken in 2.09... I think the version I fixed it in was 2.11).

I'm 99% done with the Include/Exclude/Helper window changes. I have one final logical and technical roadblock to overcome in relation to helper windows.

I'm also going to have to do some script cleanup soon and maybe break some parts off into include files. It's up to 55KB - 1800+ lines.
Back to top
View user's profile Send private message
SoLong&Thx4AllTheFish



Joined: 27 May 2007
Posts: 4999

PostPosted: Thu Mar 18, 2010 4:12 pm    Post subject: Reply with quote

maniac wrote:
I'm also going to have to do some script cleanup soon and maybe break some parts off into include files. It's up to 55KB - 1800+ lines.
Which would make it easier to include some systray icons, I just happen to have one (mini typewriter) I'll try to find it for you.

Edit: here are some nice wordlists http://wordlist.sourceforge.net/ for further investigation.
_________________
AHK Wiki FAQ
TF : Text files & strings lib, TF Forum
Back to top
View user's profile Send private message
kakarukeys



Joined: 28 Sep 2009
Posts: 86

PostPosted: Fri Mar 19, 2010 2:13 pm    Post subject: Hi Reply with quote

I will be posting more frequency word lists of different languages. I did some experiments with a pattern mining algorithm I've finished developing and found frequency-ordered word lists to be quite convenient. Actually my algorithm can build a frequency-ordered PHRASE list. But I found phrases tend to be used less often and can actually slow down typing in some cases (the mixing of phrases and words in a tooltip make reading and selection more difficult). Wictionary has a number of frequency lists, I can take without building them myself.

One thing I noticed: it's inconvenient for me (since I'm using it for ordinary typing) for TypingAid to change the case of the letters I have typed during autocompletion. A setting to choose between autocompleting the word as it is in the word list (case-sensitive) and autocompleting the remaining characters (ignore case difference in the already typed characters) is better. Plus: you can avoid the missed key problem if you choose the second setting.

Another suggestion: clicking the sys tray icon can pause the script? useful for users who like to pause the script at anytime, but can't bother to set the title options. (this is in addition to Future Features #1)

Some feedbacks sent to me:

(1) (saw maniac's comment, so you know this) a user requested a hotkey to display the remaining word/phrase options when more than 20 suggestions exist. he showed me he was using TypingAid to perform transcription with a huge set of technical terms. That's something TypingAid can do, but not better than (as at now) commercial software out there which can cost > $100. LOL.

(2) TypingAid auto-changed the case of letters already typed (two have reported annoying).

(3) default SendMethod = 1 failed on Vista (but he didn't get the hint of trying different SendMethod after reading the documentation files), should put this issue on the top of documentation or set default SendMethod = 3 (no choice Sad )

I think I can't carry on BlitzType development, I will be disclosing some innovations/insights I have in it, that will benefit TypingAid, starting from the frequency list.

P/S to maniac, tried your code to try to detect chinese characters. failed. not going to experiment with Chinese support for now, it's too difficult.
_________________
TypingAid autocompletion program made with AHK.
Back to top
View user's profile Send private message
SoLong&Thx4AllTheFish



Joined: 27 May 2007
Posts: 4999

PostPosted: Fri Mar 19, 2010 2:31 pm    Post subject: Re: Hi Reply with quote

kakarukeys wrote:
(3) default SendMethod = 1 failed on Vista (but he didn't get the hint of trying different SendMethod after reading the documentation files)
Maniac & I are working on a configuration Gui with detailed help and systray menu so this will be "solved" once ready.
_________________
AHK Wiki FAQ
TF : Text files & strings lib, TF Forum
Back to top
View user's profile Send private message
maniac



Joined: 28 Aug 2009
Posts: 267

PostPosted: Fri Mar 19, 2010 4:09 pm    Post subject: Re: Hi Reply with quote

kakarukeys wrote:
One thing I noticed: it's inconvenient for me (since I'm using it for ordinary typing) for TypingAid to change the case of the letters I have typed during autocompletion. A setting to choose between autocompleting the word as it is in the word list (case-sensitive) and autocompleting the remaining characters (ignore case difference in the already typed characters) is better. Plus: you can avoid the missed key problem if you choose the second setting.

I thought I had that listed on the planned features, but looking back I didn't have it on the list. It actually is a planned feature, someone requested it a while ago.

This still won't resolve the missed sending problem... I'll probably still have to send the Shift key several times before actually sending the typed characters. That was most of the reason the backspaces weren't always sent.

kakarukeys wrote:
Another suggestion: clicking the sys tray icon can pause the script? useful for users who like to pause the script at anytime, but can't bother to set the title options. (this is in addition to Future Features #1)

I think there is a pause in the right-click menu? Or is that only when running the AHK directly? Regardless, I plan to add a hotkey and more specific menu option for this exact feature.

kakarukeys wrote:
(1) (saw maniac's comment, so you know this) a user requested a hotkey to display the remaining word/phrase options when more than 20 suggestions exist. he showed me he was using TypingAid to perform transcription with a huge set of technical terms. That's something TypingAid can do, but not better than (as at now) commercial software out there which can cost > $100. LOL.

Yep, when we go to a listbox I hope to implement scrolling.

kakarukeys wrote:
(3) default SendMethod = 1 failed on Vista (but he didn't get the hint of trying different SendMethod after reading the documentation files), should put this issue on the top of documentation or set default SendMethod = 3 (no choice Sad )

Hmm, I'm really not sure what to do about this. SendMethod=3 is just sooo slow. Should we set SendMethod=4C to default instead??

kakarukeys wrote:
I think I can't carry on BlitzType development, I will be disclosing some innovations/insights I have in it, that will benefit TypingAid, starting from the frequency list.

P/S to maniac, tried your code to try to detect chinese characters. failed. not going to experiment with Chinese support for now, it's too difficult.

Sorry you can't carry it on, I'm looking forward to hearing what you've learned though.

Yeah, I don't think support for Chinese/Japanese/etc is feasible.


Edit:
BTW for anyone wondering, there's a bug introduced by 2.12 that allows words with numbers in them to be learned when numbers are enabled as autocomplete keys. I have a fix ready for 2.13.
Back to top
View user's profile Send private message
kakarukeys



Joined: 28 Sep 2009
Posts: 86

PostPosted: Fri Mar 19, 2010 5:54 pm    Post subject: Reply with quote

Quote:

Hmm, I'm really not sure what to do about this. SendMethod=3 is just sooo slow. Should we set SendMethod=4C to default instead??


hugov wrote:
kakarukeys wrote:
(3) default SendMethod = 1 failed on Vista (but he didn't get the hint of trying different SendMethod after reading the documentation files)
Maniac & I are working on a configuration Gui with detailed help and systray menu so this will be "solved" once ready.


Great!

Quote:
I think there is a pause in the right-click menu? Or is that only when running the AHK directly? Regardless, I plan to add a hotkey and more specific menu option for this exact feature.


Yup. one click or hotkey is faster.
_________________
TypingAid autocompletion program made with AHK.
Back to top
View user's profile Send private message
maniac



Joined: 28 Aug 2009
Posts: 267

PostPosted: Mon Mar 22, 2010 2:34 pm    Post subject: Reply with quote

*2.13 03/22/2010
** Changed the Include Title parameter to a list of partial title matches.
** Added an Include list for program executables.
** Added exclude lists for program executables and partial title matches.
** Added lists to enable the Helper Window automatically for program executables and title matches.
** If you close the Helper Window in a program for which it opens automatically, it will not re-open in that instance of the program until you tell it manually to open again.
** Word is not cleared if you type in a non-enabled window, then switch back to the previous caret position in the last enabled window.
** Changed HelperWindow to +Owner, not +ToolWindow (slightly changes appearance).
** Eliminated the flash of the "S">"H">"S" icon when loading TypingAid and the current program is not an enabled program.
** Fixed a bug introduced with 2.12 that prevented the HelperWindow from being dragged.
** Fixed a bug introduced with 2.12 that allowed words with numbers to be learned when numbers were enabled as AutoCompleteKeys.


features completed:

Introduce exclude programs, e.g. work everywhere except in notepad
Change include programs to a list
Add a way to define a list of programs for which to open the Helper Window automatically (and close the Helper Window when that program is no longer active)


Please report any questionable helper window/include/exclude behavior. I have a very specific (and large) set of rules these follow. If you want I can try to post them.

Thanks!
Back to top
View user's profile Send private message
maniac



Joined: 28 Aug 2009
Posts: 267

PostPosted: Thu Mar 25, 2010 1:08 pm    Post subject: Reply with quote

ListBox Gui pre-alpha.

Please check this out and let me know what you think. I've just barely started changing this, so I'm sure it's 80% broken, but you should at least get a list of words when you type.

Please do *not* give me any feedback on any bugs yet, I probably already know about it. I only want feedback on whether you like the list better than the tooltip.

http://www.autohotkey.net/~Maniac/TypingAid/TypingAid%20v2.13%20pre-alpha%20for%202.14.ahk

Do you guys like the fixed width font for normal typing or should I make that a non-default option?
Back to top
View user's profile Send private message
SoLong&Thx4AllTheFish



Joined: 27 May 2007
Posts: 4999

PostPosted: Thu Mar 25, 2010 1:20 pm    Post subject: Reply with quote

Yes - but you may wish to add a config option for tooltip/listbox preferences Very Happy I don't understand this bit of code
Code:
Loop, 10
{
   Gui, %DropDownGui%: Add, ListBox, vToolTip%A_Index% R%A_Index% X0 Y0
}

_________________
AHK Wiki FAQ
TF : Text files & strings lib, TF Forum
Back to top
View user's profile Send private message
maniac



Joined: 28 Aug 2009
Posts: 267

PostPosted: Thu Mar 25, 2010 2:34 pm    Post subject: Reply with quote

hugov wrote:
Yes - but you may wish to add a config option for tooltip/listbox preferences Very Happy I don't understand this bit of code
Code:
Loop, 10
{
   Gui, %DropDownGui%: Add, ListBox, vToolTip%A_Index% R%A_Index% X0 Y0
}

Yeah, some existing options may have to be changed anyway, so it would be a good idea.

That code creates 10 GuiControl types of ListBox, each with a different number of rows. It appears that the number of rows in each ListBox can't be changed once it's initially added. I'd either have to destroy the Gui and rebuild it, or create 10 different controls and show/hide them (which is what I opted to do... I assume it's more efficient).
Back to top
View user's profile Send private message
d'phil



Joined: 26 Aug 2009
Posts: 2

PostPosted: Fri Mar 26, 2010 3:52 am    Post subject: Two-finger tooltip choices, and other modifications for 2.13 Reply with quote

Two modifications to the basic (great) TypingAid script

1:
I'm a touch typist who's clumsy at finding numbers
And I'm lazy, I hate to remove my fingers from the home row
This modification allows choosing words from the tooltip
by using the custom combination of <key> & <letter or number>
(while holding down <key> hit <letter or number>

Key options:

Space - text followed by space
N (NoSpace) - text without space after
; , . - text with that punctuation after
M (as in ctrl-m command) or Enter - text with carriage return after
, & . while tooltip displayed: Toggles whether space inserted after words and punctuation, default is Yes, insert. Changes default for _subsequent_ choices, not the current one.

Letter - number options:
asdfg qwert corresponds to 1 - 0 if <key> is held down
1234567890 will choose 11 - 20 if <key> is held down

Maybe someone knows a way to do this easier than creating a
hidden window when the tooltip shows content
( create gui window hidden99 by function g99c() )
and making the custom combinations conditional #ifwinexist hidden99

==> I don't think this change is at all useful to one-finger typists, but I think it is VERY helpful to touch typists. (It is to me!) Also, still allows choosing by numbers without holding down <key>.

2:
In addition, I've added a SpecialStringCheck() function.
It looks at the chosen string before sending it.
This allows:
+ insert multi-line strings ( | is replaced with string `n )
+ insert everything after chosen character (in this first revision I chose semicolon)
- <not yet done> can make this a remarkable front end that does more than insert text, by creating rules, for example assigning character which will indicate "run the following text as ahk code" instead of "insert text"

1.3mb video file - hope it's OK to provide this link:
http://img406.imageshack.us/img406/5020/20100325001tacrop2.mp4


To avoid interfering with the original TypingAid, this (demonstration and bugs-included) Mod writes its own small wordlist.mod.txt and preferences.mod.ini

This script run in the same directory as
original file (eg TypingAid v2.13.ahk) AND include file LoopAndChangeLines_2p13.ahk

will create and load
revised file (eg TypingAid v2.13tooltip.ahk, tooltip because I also have a listbox mod)

After assigning names,
the LoopAndChangeLines include file (currently line 9) creates "RevisedFile" by looping through the "OriginalFile" line by line, creating place-sensitive additions and replacements to the original file, plus one line at the end for an include file. This include file contains the window-sensitive custom combination hotkeys and revised functions.

Code:

/*
Assign name for revised file, and original file
Run this script, it does the rest

Two modifications to the basic (great) TypingAid script

1:
I'm a touch typist who's clumsy at finding numbers
And I'm lazy, I hate to remove my fingers from the home row
This modification allows choosing words from the tooltip
by using the custom combination of <key> & <letter or number>
(while holding down <key> hit <letter or number>

Key options:

Space - text followed by space
N (NoSpace) - text without space after
; , . - text with that punctuation after
M (as in ctrl-m command) or Enter - text with carriage return after
, & . while tooltip displayed: Toggles whether space inserted after words and punctuation, default is Yes, insert. Changes default for _subsequent_ choices, not the current one.

Letter - number options:
asdfg qwert corresponds to 1 - 0 if <key> is held down
1234567890 will choose 11 - 20 if <key> is held down

Maybe someone knows a way to do this easier than creating a
hidden window when the tooltip shows content
( create gui window hidden99 by function g99c() )
and making the custom combinations conditional #ifwinexist hidden99

==> I don't think this change will be at all useful to one-finger typists, but I think it will be VERY helpful to touch typists.  (It is to me!)  Also, still allows choosing by numbers without holding down <key>.

2:
In addition, I've added a SpecialStringCheck() function.
It looks at the chosen string before sending it to be entered.
This allows:
+ insert multi-line strings ( | is replaced with string `n )
+ insert everything after chosen character (in this first revision I chose semicolon)
- <not yet done> can make this a remarkable front end that does more than insert text, by creating rules, for example assigning character which will start branch "run the following text as ahk code" instead of "insert text"


To avoid interfering with the original TypingAid, this (demonstration and bugs-included) Mod writes its own small wordlist.mod.txt and preferences.mod.ini

This script run in the same directory as
original file (eg TypingAid v2.13.ahk)
will create and load
revised file (eg TypingAid v2.13tooltip.ahk, tooltip because I also have a listbox mod


After assigning names,
The modTA include file (currently line 9) creates "RevisedFile" by looping through the "OriginalFile" line by line, creating place-sensitive additions and replacements to the original file, plus one line at the end for an include file.  This include file contains the window-sensitive custom combination hotkeys and revised functions

*/
 
OriginalFile = TA_2p13ori.ahk
IfNotExist, %OriginalFile%
InputBox, OriginalFile, , Type Name of File to modify`, located within script directory:,,,,,,,,%OriginalFile%
IfNotExist, %OriginalFile%
MsgBox,,, Error`, try again, 2
RevisedFile = TA_2p13ModToolTip.ahk
IncludeFile = %RevisedFile%.include.txt
ofile := OriginalFile
rfile := RevisedFile
ifil := IncludeFile
FileDelete, % rfile
FileDelete, % ifil

;#Include modTA.011_2p13a.ahk ; original to modify ori
;#Include modTA.011_2p13aa.ahk ; simplify the sendvalue commands, works
;#Include modTA.011_2p13aaa.ahk ; try to allow any sendmethod
#Include LoopAndChangeLines_2p13.ahk ; SendFullMod(sending, StrLen(Word))
/*
This Include File does place-sensitive additions and replacements within the original TypingAid v2.13, including adding 1 line for an include file at the end of the Modified TypingAid.

TMod11.txt is created below, the code is not place-sensitive and doesn't replace existing TypingAid code

This modification allows:
- custom combination hotkeys starting with ; or , or .
- choosing among the first 10 items by ;/,/. & letter chosen by the left hand
- choosing among the last 10 items by ;/,/. & Number 1 - 0
- ; just adds selection, while ,/. will add selection plus punctuation.
*/

ChooseString = asdfgqwert1234567890
cs := ChooseString
; FirstChar of combination hotkey determines action after item is chosen:
; Space -> space
; n -> No Space m Carriage return (like the old control m)
; ; or , or . -> that punctuation added

FileAppend, #IfWinExist`, hidden99`n, % ifil
loop, 20
{
i := A_Index
hk2 := SubStr(cs, i, 1)
FileAppend, ```; & %hk2%::`nCheckWord(`"$%i%`")`ng99d()`nreturn`n, % ifil
FileAppend, `. & %hk2%::`nCheckWord(`"$%i%`")`ng99d()`nreturn`n, % ifil
FileAppend, `, & %hk2%::`nCheckWord(`"$%i%`")`ng99d()`nreturn`n, % ifil
FileAppend, space & %hk2%::`nCheckWord(`"$%i%`")`ng99d()`nreturn`n, % ifil
FileAppend, enter & %hk2%::`nCheckWord(`"$%i%`")`ng99d()`nreturn`n, % ifil
FileAppend, m & %hk2%::`nCheckWord(`"$%i%`")`ng99d()`nreturn`n, % ifil
FileAppend, n & %hk2%::`nCheckWord(`"$%i%`")`ng99d()`nreturn`n, % ifil
}

FileAppend, `;::`ng99d()`nsend`, ```;`nreturn`n, % ifil
FileAppend, `,::`ng99d()`nsend`, ```,`nreturn`n, % ifil
FileAppend, `.::`ng99d()`nsend`, ```.`nreturn`n, % ifil
FileAppend, space::`ng99d()`nsend`, {space}`nreturn`n, % ifil
FileAppend, enter::`ng99d()`nsend`, {enter}`nreturn`n, % ifil
FileAppend, m::`ng99d()`nsend`, m`nreturn`n, % ifil
FileAppend, n::`ng99d()`nsend`, n`nreturn`n, % ifil
FileAppend, `, & `.::`ngosub`, ToggleDefSpace`nreturn`n, % ifil
FileAppend, #IfWinExist`n`n, % ifil

FileAppend,
(
g99c()
{
gui, 99:add, Text, ,
gui, 99:show, hide, hidden99
}

g99d()
{
gui, 99:destroy
}

ToggleDefSpace:
if (DefSpace=" ")
DefSpace=
else
DefSpace:= a_space
return

), % ifil

FileAppend,
(
AddToMatchListMod(position,value)
{
   global   
   Local prefix
   IfGreater, position, 20
   {
      prefix =
   } else {   
            pickletters = asdfgqwert1234567890
   IfLessOrEqual, position, 10
         prefix := Mod(position,10) . substr(pickletters
         ,Mod(position,20), 1) . ". "
   else
         prefix := " " . substr(pickletters
         ,Mod(position,20), 1) . ". "
         }

   IfEqual, ArrowKeyMethod, Off
   {
      match .= prefix . value . "``n"
   } else {
            IfEqual, MatchPos, `%Position`%
            {
               match .= ">" . prefix . value . "``n"
            } Else {
                     match .= "   " . prefix . value . "``n"
                  }
         }
}

), % ifil

FileAppend,
(
SpecialStringCheck(byref sending)
{
global
IfInString, sending, ```;
{
sending2 := SubStr(sending, InStr(sending, ";", False ,0)+1)
sending := sending2
}
IfInString, sending, ..
{
;sending2 := SubStr(sending, 1, InStr(sending, "..", False ,0)) . "``n"
sending2 := SubStr(sending, 3)
sending := sending2
;Return
}
IfInString, sending, |
{
;sending2 := SubStr(sending, 1, InStr(sending, "|", False ,0)-1) . "``n"
StringReplace, sending2, sending, |, ``n, All
AddSpace =
sending := sending2
Return
}
sending2 := sending
}

), % ifil

FileAppend,
(
Esc::ExitApp
^!r::Reload

), % ifil

FileAppend, ; this will be SendFullMod(x,y)
(
SendFullMod(SendValue,BackSpaceLen)
{
   global SendMethod, addSpace, DefSpace
   global A_id
   SpecialStringCheck(SendValue)
   
StringLeft, hkFirstChar, a_thishotkey, 1

`; override | as last character sending NewLine before punctuation
punc:="`;,."
stringright, stringlastchar, SendValue, 1

ifinstring, punc, `%hkFirstChar`%
{
stringright, stringlastchar, SendValue, 1
if (stringlastchar="``n")      {
stringtrimright, sendvalue, sendvalue, 1
LastAdd = ``n
                  }
}

if (hkFirstChar = ".") or (hkFirstChar = ",") or (hkFirstChar = ";")
FirstAdd := hkFirstChar

if (hkFirstChar = "s" ) or (hkFirstChar = "$" )
sleep, 1
; space allows default - space
;sending = {Shift Up}{Shift Down}{Shift Up}{BS `%BackSpaceLen`%}{Raw}`%SendValue`%

if (hkFirstChar = "e" ) or (hkFirstChar = "m")
{
AddSpace=
LastAdd = ``n
}

if (hkFirstChar = "n" )
AddSpace=
 
sending = {Shift Up}{Shift Down}{Shift Up}{BS `%BackSpaceLen`%}{Raw}`%SendValue`%`%FirstAdd`%`%LastAdd`%`%AddSpace`%
AddSpace := DefSpace

   IfEqual, SendMethod, 1
   {
      ; Shift key hits are here to account for an occassional bug which misses the first keys in SendPlay
`; sending is previously assigned      sending = {Shift Up}{Shift Down}{Shift Up}{BS `%BackSpaceLen`%}{Raw}`%SendValue`%
      SendPlay, `%sending`% ; First do the backspaces, Then send word (Raw because we want the string exactly as in wordlist.txt)
      Return
   }
`; don't know yet how to integrate these   sending = {BS `%BackSpaceLen`%}{Raw}`%SendValue`%
   
   IfEqual, SendMethod, 2
   {
      SendInput, `%sending`% ; First do the backspaces, Then send word (Raw because we want the string exactly as in wordlist.txt)     
      Return
   }

   IfEqual, SendMethod, 3
   {
      SendEvent, `%sending`% ; First do the backspaces, Then send word (Raw because we want the string exactly as in wordlist.txt)
      Return
   }
   
   ClipboardSave := ClipboardAll
   Clipboard =
   Clipboard := SendValue
   ClipWait, 0
   
   sending = {BS `%BackSpaceLen`%}^v
   
   IfEqual, SendMethod, 1C
   {
      sending := "{Shift Up}{Shift Down}{Shift Up}" . sending
      SendPlay, `%sending`% ; First do the backspaces, Then send word via clipboard
   } else {
            IfEqual, SendMethod, 2C
            {
               SendInput, `%sending`% ; First do the backspaces, Then send word via clipboard
            } else {
                     IfEqual, SendMethod, 3C
                     {
                        SendEvent, `%sending`% ; First do the backspaces, Then send word via clipboard
                     } Else {                     
                              sending = {BS `%BackSpaceLen`%}{Ctrl Down}v{Ctrl Up}
                              ControlGetFocus, ActiveControl, ahk_id `%A_id`%
                              IfNotEqual, ActiveControl,
                                 ControlSend, `%ActiveControl`%, `%sending`%, ahk_id `%A_id`%
                           }
                  }
         }
         
   Clipboard := ClipboardSave
   Return
}


), % ifil

IfNotExist, wordlist.mod.txt
{
contents=
(
..Two periods are automatically eliminated.
..This means you can put in choices (menus, if you will)
..Based on plain text
..This is fun|For girls and boys|Of all ages|
..Try ;Hey Hey AutoHotKey is the Greatest
..TryThis ;He ain't heavy|He's my brother|He is heavy!|
[heay
[heab
[heck
/headaches headachier  ;hi there
h;e is here
h;h-triggered words ;Starting with this little gem
He is a nut.
He is a filbert.
He is a pecan.
He is a peanut.
He is a nut.
He is a peanut.
He is a nut.
He is a nut|
He is a nut, a nutty nut|
He is a nutcase.
abaci
aback
abacus
abacuses
abaft
abalone
abalones
abandon
abandoned
abandonedly
abandonee
abandoner
abandoners
abandoning
abandonment
abandonments
abandons
abase
abased
abasedly
abasement
abaser
abasers
abases
abash
abashed
abashedly
abashes
abashing
abashment
abashments
abasing
abatable
abate
abated
abatement
abatements
abater
abaters
abates
abating
abatis
abatises
abator
abattoir
abattoirs
abbacies
abbacy
abbatial
abbe  ;A semicolon is interpreted as: don't type what goes before.
abbes ;Is it the first semicolon; or the last semicolon.
;LEARNEDWORDS;
)
FileAppend, %contents%, wordlist.mod.txt
}

IfNotExist, Preferences.mod.ini
{
contents=
(
[IncludePrograms]
IncludeProgramExecutables=
IncludeProgramTitles=
ExcludeProgramExecutables=
ExcludeProgramTitles=
;
[Settings]
Length=2
NumPresses=1
ToolTipOffset=14
ToolTipLineHeight=13
LearnMode=Off
LearnCount=5
LearnLength=5
ArrowKeyMethod=First
DisabledAutoCompleteKeys=
DetectMouseClickMove=On
SendMethod=1
MaxMatches=20
TerminatingCharacters={enter}{space}{bs}{esc}{tab}{Home}{End}{PgUp}{PdDn}{Up}{Dn}{Left}{Right}???!()$
ForceNewWordCharacters=
;
;
[HelperWindow]
HelperWindowProgramExecutables=
HelperWindowProgramTitles=
XY=200,277

)
FileAppend, %contents%, Preferences.mod.ini
}

MsgBox,,, You have modified TypingAid`nAnd Now %rfile% will be loaded`nEscape will exit it, 2

run % rfile



Needs to have this as include-file in same directory

Code:

; Title LoopAndChangeLines_2p13.ahk
; This needs to be run as an include file in ModifyTypingAidxxx.ahk
loop, read, %ofile%
{
x := A_LoopReadLine
; DefSpace (DefaultSpace) IS a space, toggle by , & .
If (InStr(x, "CONFIGURATION"))   {
AddAfter("DefSpace := a_space")
Replace("AddSpace := DefSpace")
Continue                  
                        }
; g99d() destroys the hidden window that activates the custom combo keys
If (InStr(x, ";tryout Word=`n"))   {
AddBefore("g99d()")
Continue                  
                           }

If (InStr(x, "Input, chr, L1 V, {BS}%TerminatingCharacters%"))   {
AddAfter("g99d()")
Continue                  
                                             }
                                             
If (InStr(x, ";tryout ToolTip,")) and !(InStr(x, "CoordMode"))   {
AddAfter("g99d() `;pw ")
Continue                  
                                                }
If (InStr(x, "SetTitleMatchMode, 2"))   {
AddAfter("DetectHiddenWindows, On")
AddComment("Because each displayed tooltip creates the hidden window 'hidden99' which activates the custom key combinations")
Continue                     
                              }
; When the tooltip displays, the custom combinations are activated:
If (InStr(x, "ToolTip, %match%"))   {
AddAfter("g99c() `;pw ")
Continue                     
                           }
; Can't have , . ; as both terminating characters and custom combinations
If (InStr(x, "DftTerminatingCharacters = {enter}{space}{esc}{tab}"))   {
Replace("DftTerminatingCharacters = {enter}{space}{esc}{tab}{Home}{End}{PgUp}{PgDn}{Up}{Down}{Left}{Right}???!'()[]{}{}}{{}``~``%$&*-+=\/><^|@#:")
Continue
                                                   }
; Since this is for demo purposes:
If (InStr(x, "Preferences.ini"))   {
ReplacePartOfLine("Preferences.ini","Preferences.mod.ini")
Continue
                                                      }

If (InStr(x, "wordlist.txt"))   {
ReplacePartOfLine("wordlist.txt","wordlist.mod.txt")
Continue
                        }

; The ifil (include file) has
; the custom hotkey definitions
; g99c() and g99d()
; And the modified functions
; AddToMatchListMod(position,value)
; SpecialStringCheck(byref sending)
; SendFullMod(SendValue,BackSpaceLen)

If (InStr(x, "ExitApp"))                  {
AddAfter("`n`n#Include *i " . ifil . " `n ")
Continue                  
                                    }
                  
If (InStr(x, "AddToMatchList(A_Index,singlematch%A_Index%)"))   {
Replace("AddToMatchListMod(A_Index,singlematch%A_Index%)")
Continue                  
                                                }
                                          
If (InStr(x, "SendFull(sending, StrLen(Word))"))   {
Replace("SendFullMod(sending, StrLen(Word))")
Continue                  
                                       }


If (InStr(x, "StringRight, Key, Key, 1"))   {
AddComment(x)
Replace("StringLeft, FirstChar, a_thishotkey, 1")
Replace("StringTrimLeft, key, key, 1")
Continue                  
                                 }
                                    
If (InStr(x, "IfEqual, Key, 0"))   {
Replace("IfEqual, Key, 20")
Continue                  
                           }
                                    
If (InStr(x, "WordIndex = 10"))   {
Replace("WordIndex = 20")
Continue                  
                        }

If (InStr(x, "xx global SendMethod"))   {
Replace("global SendMethod, firstchar, AddSpace, DefSpace")
Continue                  
                           }

If (InStr(x, "xx SendPlay, %sending%"))   {
Replace("SendPlay, %sending%%AddSpace%")
AddComment(x)
Replace("AddSpace := DefSpace")
Continue                  
                              }

FileAppend, %x%`n, %rfile%
} ; end of loop


ReplacePartOfLine(oristring,newstring)
{
global
StringReplace, x, x, %oristring%, %newstring%
FileAppend, %x%`n, %rfile%
}

OriginalLine()
{
global
FileAppend, %x%`n, %rfile%
}

AddAfter(z)
{
global
FileAppend, %x%`n, %rfile%
FileAppend, %z%`n, %rfile%
}

AddBefore(z)
{
global
FileAppend, %z%`n, %rfile%
FileAppend, %x%`n, %rfile%
}

AddComment(z)
{
global
FileAppend, `; %z%`n, %rfile%
}

Replace(z)
{
global
FileAppend, %z%`n, %rfile%
}


Sorry if this is overly complicated showing the modifications this way. I love writing code but I'm not a professional.

I'm hoping that at least the custom combination keys might be incorporated into the main script (as a choice that touch typists might like. I can sure make choices faster this way).

AHK is fantastic, and this script is one of the most useful I've seen! Very much looking forward to seeing how it evolves...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2, 3 ... 8, 9, 10 ... 30, 31, 32  Next
Page 9 of 32

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group