Sign in to follow this  
Followers 0
Bert

_ispressed question

13 posts in this topic

There is a program that I like to make. It works like this program:

http://www.pcmag.com/article2/0,4149,427373,00.asp

The program is called Robotype. A description of the program from PC mag's site:

Do you find yourself typing the same phrases and paragraphs repeatedly? Perhaps you prepare business documents that contain standard paragraphs. Or maybe you're a tech-support provider and you have to answer the same questions over and over via e-mail. Do you constantly have to type the same long and complicated URLs? You could save your reusable text in a document and cut and paste from there, but that approach is clumsy. Some programs have macro expansion facilities, but not all. RoboType 3, which adds a text-expansion feature to almost any Windows program, is a better solution. You define abbreviations for the words, phrases, and paragraphs that you frequently type and RoboType 3 does the rest, replacing your abbreviations with the expanded text. This latest update of RoboType includes numerous enhancements. A new groups feature lets you organize your abbreviations by category. A new tag feature lets you use variables such as date and time when defining expansion text. And you'll find many smaller refinements throughout the program.

In a nutshell, you can make a shorthand keystroke, such as "mj", and when you type this, then hit the spacebar, it will replace "mt" with what you have in longhand. An example would be "this is a long sentence". Where I work won't let me use Robotype, but if I make my own using AutoIt, I can use that to my taste.

seeing how you can use _ispressed to do such a thing, how would one make it so you can add your shorthand items (as many as you want), have it monitor everything one types, and not be a processor hog?

Share this post


Link to post
Share on other sites

There is a program that I like to make. It works like this program:

http://www.pcmag.com/article2/0,4149,427373,00.asp

The program is called Robotype. A description of the program from PC mag's site:

In a nutshell, you can make a shorthand keystroke, such as "mj", and when you type this, then hit the spacebar, it will replace "mt" with what you have in longhand. An example would be "this is a long sentence". Where I work won't let me use Robotype, but if I make my own using AutoIt, I can use that to my taste.

seeing how you can use _ispressed to do such a thing, how would one make it so you can add your shorthand items (as many as you want), have it monitor everything one types, and not be a processor hog?

Hello Volly,

I like this idea. I could be very useful when fully developed. Here is where I would start. I would create a spreadsheet with 'keywords' and matching 'phrases'. Then use hotkeys, for example, F1 to match just the last word typed to the 'keyword' and replace the keyword with the 'phrase' in the typed text. Use F2 to match the last two words typed to find them in the spreadsheet and replace the two words in the typed text with the matching phrase. Use F3 . . .

I am sure there are better ways to do this, but what I find is that it's hard for me to see the better ways until I start doing it different way.

I would like to do something like this, but I have two other programs I am currently working on. Good luck.

taurus905


"Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs

Share this post


Link to post
Share on other sites

Hello Volly,

I like this idea. I could be very useful when fully developed. Here is where I would start. I would create a spreadsheet with 'keywords' and matching 'phrases'. Then use hotkeys, for example, F1 to match just the last word typed to the 'keyword' and replace the keyword with the 'phrase' in the typed text. Use F2 to match the last two words typed to find them in the spreadsheet and replace the two words in the typed text with the matching phrase. Use F3 . . .

I am sure there are better ways to do this, but what I find is that it's hard for me to see the better ways until I start doing it different way.

I would like to do something like this, but I have two other programs I am currently working on. Good luck.

taurus905

That sounds better, but I think my preference would be an .ini file that was read when the utility was started. A one-time IniReadSection() into an array would hold the data in memory for very fast access without as much overhead as a spreadsheet. The file does not have to be held open, and is still easy to update.

@Volly: About your key logger... ;)

I would imagine that working off hotkeys, like Ctrl-m to invoke the macro, then "mt" to get and Send() and the full text to whatever you are working in. The hotkey keeps you from having to monitor everything the user types. When the hotkey is hit, the script (which was running in the background) would note the Window and perhaps even control that had focus and direct a ControlSend() at it, perhaps.

Another hotkey, like Alt-m would cause the script to pop a dialog for creating a new macro.

An interesting script. I hope you get it working!

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

That sounds better, but I think my preference would be an .ini file that was read when the utility was started. A one-time IniReadSection() into an array would hold the data in memory for very fast access without as much overhead as a spreadsheet. The file does not have to be held open, and is still easy to update.

@Volly: About your key logger... ;)

I would imagine that working off hotkeys, like Ctrl-m to invoke the macro, then "mt" to get and Send() and the full text to whatever you are working in. The hotkey keeps you from having to monitor everything the user types. When the hotkey is hit, the script (which was running in the background) would note the Window and perhaps even control that had focus and direct a ControlSend() at it, perhaps.

Another hotkey, like Alt-m would cause the script to pop a dialog for creating a new macro.

An interesting script. I hope you get it working!

:)

That would make it easier to do. I see what Larry said, but I have no experience with dll coding. It should be something I should learn. also, IT IS NOT A KEYLOGGER! it is a macro tool! ;)

Share this post


Link to post
Share on other sites

I wrote a "ShortHand" script and it was cool, though I never used it and have subsequently misplaced it... it would monitor your keys and evaluate the "current word" when you pressed [TAB] or some other key, I don't remember... The "evaluate" key was a HotKey...

Lar.

The HotKey is the... well... key. I think it could be done easier by hitting a defined HotKey FIRST, then the script would watch for a specific combo like "mt" and translate it to a send of "macro translator", or whatever. Wouldn't that be easier, since the script remains dormant and doesn't have to track anything until the HotKey happens?

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

I wrote a "ShortHand" script and it was cool, though I never used it and have subsequently misplaced it... it would monitor your keys and evaluate the "current word" when you pressed [TAB] or some other key, I don't remember... The "evaluate" key was a HotKey...

Lar.

If you could find it, that would be just the thing I would need. I could build the rest of it rather easily with what I have in mind.

Share this post


Link to post
Share on other sites

Larry, you rock! Thanks!

Did Larry's code run for you? It didn't for me, but maybe I didn't do something right...

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Didnt run for me neither:

C:\Documents and Settings\James\My Documents\My Programming\mm.au3(52,70) : WARNING: $hhKey: possibly used before declaration.
    DLLCall("user32.dll","int","UnhookWindowsHookEx","hwnd",$hhKey[0])
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\James\My Documents\My Programming\mm.au3(53,66) : WARNING: $DLLinst: possibly used before declaration.
    DLLCall("kernel32.dll","int","FreeLibrary","hwnd",$DLLinst[0])
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\James\My Documents\My Programming\mm.au3(44,63) : WARNING: $hhKey: declared global in function only. Prefer top of file.
            "hwnd",$keyHOOKproc[0],"hwnd",$DLLinst[0],"int",0)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\James\My Documents\My Programming\mm.au3 - 0 error(s), 3 warning(s)

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

That sounds better, but I think my preference would be an .ini file that was read when the utility was started. A one-time IniReadSection() into an array would hold the data in memory for very fast access without as much overhead as a spreadsheet. The file does not have to be held open, and is still easy to update.

PsaltyDS,

Yes. I like you .ini file idea better than my spreadsheet one.

@Larry - the hook.dll is very interesting and you program works well. It could be a great base for a few projects. I hope Volly uses it. Thanks for sharing.

taurus905

Edit: This is great. The more I think about it the more ideas I get. It would make a good "poor-man's" IntelliSense.

Edited by taurus905

"Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs

Share this post


Link to post
Share on other sites

I'm planning to add it to a viewer that I made for USD. One of the tools I have is a quickpaste tool that saves keystrokes, but I wanted to add the macro stuff this thread talks about. WHen I finish it, I will post the code.

I keep comming up with ideas, and not enough time to code them all....I still need to get back to the buttons thing for Scite....and my flash game player.....and all the tools fellow employees ask me to build....

Posted Image

Share this post


Link to post
Share on other sites

I keep comming up with ideas, and not enough time to code them all....I still need to get back to the buttons thing for Scite....and my flash game player.....and all the tools fellow employees ask me to build....

Posted Image

Volly,

I know exactly where you are coming from. I currently have two projects I am working on which I am contantly getting new ideas about. If I only had the time . . .

And the more I read the forum, the more I want to add. And then I run across posts like this which make me want to start yet another project or add features to the ones I am working on. It sometimes looks like a daunting task. But it reminds me of the old Chinese saying, "How do you eat an elephant?" Answer: "One bite at a time." So keep up the good work in building your karma.

taurus905


"Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0