Jump to content

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

Autocomplete 1.2


  • Please log in to reply
207 replies to this topic
Peace
  • Members
  • 8 posts
  • Last active: Apr 25 2015 01:18 PM
  • Joined: 17 Mar 2015

Hi,

 

Someone can tell me what i need to change in the code to focus only in my desired windows/app (no suggestion in all windows), please ?

 

Best Regards.

Hi,

I'm asking again the question because i doesn't have a reply. I need to focus the AutoComplete only in one window please !

I hope that someone skilled in coding can help me ! Thank you in advance !

Best Regards.



space
  • Members
  • 520 posts
  • Last active:
  • Joined: 12 Aug 2014
Typing Aid supports this out of the box but is a "heavy" program - https://github.com/ManiacDC/TypingAid/you'll find the link to the forum post at the very top of the GH page, well worth reading if you're into typing in general

Now, if you look at https://github.com/U...omplete.ahk#L73you'll see that SetHotkeys is the function that sets up the hotkeys (to keep track of typed text)

You'll find that at https://github.com/U...mplete.ahk#L328

As you can see it uses the Hotkey command - http://ahkscript.org...ands/Hotkey.htm

If you study the docs you can find the it can use a IfWinActive parameter, I would look into that and add that to the loops in the SetHotkeys function to see if that works. (I haven't tried it but sounds logical to me)

Alternative posted by someone here http://ahkscript.org...&p=41397#p41397

Peace
  • Members
  • 8 posts
  • Last active: Apr 25 2015 01:18 PM
  • Joined: 17 Mar 2015

Typing Aid supports this out of the box but is a "heavy" program - https://github.com/ManiacDC/TypingAid/you'll find the link to the forum post at the very top of the GH page, well worth reading if you're into typing in general

Now, if you look at https://github.com/U...omplete.ahk#L73you'll see that SetHotkeys is the function that sets up the hotkeys (to keep track of typed text)

You'll find that at https://github.com/U...mplete.ahk#L328

As you can see it uses the Hotkey command - http://ahkscript.org...ands/Hotkey.htm

If you study the docs you can find the it can use a IfWinActive parameter, I would look into that and add that to the loops in the SetHotkeys function to see if that works. (I haven't tried it but sounds logical to me)

Alternative posted by someone here http://ahkscript.org...&p=41397#p41397

Hi space,

 

Thank you for the reply, i just found the answer after reading and reading the code for several minutes !! Youpi :)

 

I just added #IfWinActive, Title at this line https://github.com/U...mplete.ahk#L248 and now that focus in my program and not an other !

 

And the last link that you have posted is linking to my other topic opened in ahkscript.org

 

BTW thank you bro for the help :)

 

Best regards.



Peace
  • Members
  • 8 posts
  • Last active: Apr 25 2015 01:18 PM
  • Joined: 17 Mar 2015

Hi all,

 

It's me again ^^

 

I'm facing to another problem, i'm trying to add an icon before the suggestion instead of the numbers (1., 2. ,3. etc...). Someone can put me in the right way or just tell me how to make it possible please ?

 

Best regards.



space
  • Members
  • 520 posts
  • Last active:
  • Joined: 12 Aug 2014
As you can see here https://github.com/U...omplete.ahk#L66it makes use a listbox to show the results, afaik it is not possible to show icons in listbox - you can in a listview so you would have to change the code to make it a listview but that would also mean altering more sections of the code to make it all work again - http://ahkscript.org...ds/ListView.htm (you also need to change the up/down hotkeys)

Peace
  • Members
  • 8 posts
  • Last active: Apr 25 2015 01:18 PM
  • Joined: 17 Mar 2015


As you can see here https://github.com/U...omplete.ahk#L66it makes use a listbox to show the results, afaik it is not possible to show icons in listbox - you can in a listview so you would have to change the code to make it a listview but that would also mean altering more sections of the code to make it all work again - http://ahkscript.org...ds/ListView.htm (you also need to change the up/down hotkeys)

 

Hi space, sorry for the late but i was busy ! Thank you for the explain, i think i don't will use icon...

 

I noticed a little bug if it's one, if i set the Trigger Lenght to 3 and add the values u05929 and u06156 to the wordlist. When i type u05 the suggestion listbox show me the two values and not only u05929. Or if i type an number with a . that show me a result only if i type another number after but with the same problem as before (i delete in ResetKeyList the `n. in case).

 

How i can fix it please ?

 

Here is some screenshots for example :

 

image.png image.png

 

Best regards and thank you in advance for the help.

 

Edit: I think the problem can be solved in the Suggest Function but i don't know what to modify. If someone skilled can put me in the right way please ! Thanks

 



vasili111
  • Members
  • 40 posts
  • Last active: Feb 14 2016 07:25 AM
  • Joined: 08 Apr 2013

It will be nice to add option to autocomplete words and phrases from google suggest.

This is not working but maybe helpful: http://www.autohotke...tions-anywhere/



vasili111
  • Members
  • 40 posts
  • Last active: Feb 14 2016 07:25 AM
  • Joined: 08 Apr 2013

I found information how to get google suggestions and summarize it here: http://stackoverflow...9751752/1601703



vasili111
  • Members
  • 40 posts
  • Last active: Feb 14 2016 07:25 AM
  • Joined: 08 Apr 2013

I made a function that returns google suggest. It is here: http://ahkscript.org...&t=7182&p=43359So if you decide to use google suggests feel free to use that code.



Exaskryz
  • Members
  • 3249 posts
  • Last active: Nov 20 2015 05:30 AM
  • Joined: 23 Aug 2012


Update: I was inspired by berban to revisit this old script, and I have made speed improvements - approximately 30 times faster - when searching the wordlist. However, it requires a wordlist that is sorted by the first character of each item. The new searching method is simply a prefix table (a table of pointers to the beginning of a certain prefix) combined with the original search, for a good balance between speed and memory usage. Please redownload the script and the wordlist (both of them - the wordlist has been updated too) to take advantage of the changes.

 

This sounds really useful. I haven't run through the thread much as I'll be coming back to it in a month's time, but how much of a problem will there be if the wordlist is not alphabetical? I've got a script right now that will sort a list that can be added to, but only at certain points and not everytime an item is added. Would I need to modify my script to always update the list so its sorted? Because my wordlist is small -- 200 words or so -- I don't think a slower algorithm is going to be much of a problem.



Skrell
  • Members
  • 384 posts
  • Last active: Jul 07 2016 05:03 PM
  • Joined: 23 Aug 2011

<Delete this please>



10basetom
  • Members
  • 9 posts
  • Last active: May 12 2015 06:00 PM
  • Joined: 03 Jul 2007

Hi, I have an entry in WordList.txt that starts with "<script...", but it is not autocompleting. What am I missing here?

 

UPDATE: Never mind, I figured it out -- you have to add the URL-encoded string for "<" to OtherKeyList in the settings file:

OtherKeyList=%27%0A-%0A%3C


10basetom
  • Members
  • 9 posts
  • Last active: May 12 2015 06:00 PM
  • Joined: 03 Jul 2007

Since I find this script very useful for my coding needs, I have forked Uberi's version to add features that are more conducive to development:

 

https://github.com/thdoan/Autocomplete

 

Here's my first draft of changes:

  • Added support for "<" character by default (to autocomplete <tag>)
  • Added support for NumPad navigation in suggestions list
  • Added ability to navigate suggestions list with PgUp/PgDn
  • Added ability to autocomplete code snippets with newlines (\n) and tabs (\t)
  • Added ability to move caret to indicator (|) after autocompleting (escape with \| if you want to insert a literal pipe)
  • Added ability to close suggestions list by pressing Esc
  • Added ability to add new word in Preferences by pressing Enter
  • Changed monospace font to Consolas
  • Changed default minimum trigger length to 2
  • Changed suggestions list hotkeys from Alt + <Num> to <Num>
  • Changed to clear "new word" edit box after adding to wordlist
  • Changed Preferences wordlist to alphabetical order (sorted)
  • Replaced English word list with a few code samples
  • Fixed "0." not displayed in suggestions list
  • Fixed incompatibility bug with v1.1.20.00 and higher
  • Fixed horizontal scrollbar in Preferences wordlist

I'll eventually add more features as I use it more (I just discovered this wonderful script a few hours ago). One thing that I'm not happy with is not being able to indicate the caret position in a code block with newlines (currently it only works on one-liners), but this is something to look into for another rainy day.