| View previous topic :: View next topic |
| Author |
Message |
fogus
Joined: 28 Mar 2007 Posts: 28
|
Posted: Thu Oct 25, 2007 5:31 pm Post subject: Autodetecting long words |
|
|
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 |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 6847 Location: Pacific Northwest, US
|
Posted: Thu Oct 25, 2007 5:48 pm Post subject: |
|
|
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 |
|
 |
fogus
Joined: 28 Mar 2007 Posts: 28
|
Posted: Thu Oct 25, 2007 10:09 pm Post subject: |
|
|
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 |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 6847 Location: Pacific Northwest, US
|
Posted: Thu Oct 25, 2007 10:25 pm Post subject: |
|
|
are you using Scite4Ahk? _________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM |
|
| Back to top |
|
 |
|