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 

Autodetecting long words

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
fogus



Joined: 28 Mar 2007
Posts: 28

PostPosted: Thu Oct 25, 2007 5:31 pm    Post subject: Autodetecting long words Reply with quote

Hi,

I have a need to create a script that monitors the long words that I type (say, 10 characters or more). I do a lot of programming now, and it would be much less of a hassle if my variable names would be automatically entered for me. I like to use longer names at the start of programming because it makes it easier to read.

I know there is something about the #installkeyboardhook that should help me out here.

I think the code should go something like this:
1. Monitor keystrokes
2. If he types a word (characters broken by a space) that is 10 characters long, add it to the list (at the top, so most recent is always grabbed first)
3. If he starts typing a word that is already in the list, by entering the first characters of that word, insert the word for him.
4. If he presses {space} leave the word
5. Else, if he presses {next character in the expected word} leave the word (perhaps I would have to delete the word and re-insert it. doesn't matter to me)
6. Else, if he enters {a different character than the next character in the expected word} remove the word.

Where I'm stuck is trying to figure out how to say:

IF user presses {this key}
DO THIS STUFF

and with:

IF user enters a string of characters length > 10, broken by a space
add that word to the top of a list

Any help would be great.
Back to top
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 6847
Location: Pacific Northwest, US

PostPosted: Thu Oct 25, 2007 5:48 pm    Post subject: Reply with quote

what editor do you use? Any good one remembers your variable names of any length and can recall them for you at will. in PSPad, the hotkey is ^j.
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
fogus



Joined: 28 Mar 2007
Posts: 28

PostPosted: Thu Oct 25, 2007 10:09 pm    Post subject: Reply with quote

I have been using SCiTE with python code. I'll go check out PSPad.

Also, in scite, I have been having a tricky time defining my colour scheme for the various types of operators. Anyone know how to create a new colour scheme for a new language?
Back to top
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 6847
Location: Pacific Northwest, US

PostPosted: Thu Oct 25, 2007 10:25 pm    Post subject: Reply with quote

are you using Scite4Ahk?
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
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