Jump to content

Monitoring user input for special string


Recommended Posts

Hi everyone !

I didn't find an answer to my question on the forum yet, or maybe I have been looking for the wrong keywords, so I'm coming to you in my quest for an idea (if not of a solution).

For quite a long time now I've had a resident script running on my computer (I call it resident because it is permanently running 24/7). It allows me to continuously monitor inputs such as Ctrl-Alt-<Something> or Windows-<Something> which then trigger various functions declared in the script.

What I would like to do, however, is to implement additionnally a "string-recognition" tool (I hope this makes sense in English), which would be watching for all keys I type on my keyboard, and trigger a function when the following combination (no, actually, the following "succession") of keys, in the right order of course, would have been typed. So for example, I would type something I never type, say "hw!", and it would trigger a function.

My ultimate view, as this might help you understand what I want to do, is to create a search-and-replace tool. So in fact, I would type "hw!" as I said earlier, in any program, input box, whatever, and I'd like that the second I finish typing the "!" of "hw!", the function would realize that this is a string to match and trigger the function that would replace "hw!" by "hello world !".

Can anyone think of a solution to implement this, or at least give me some hints or point me in the right direction ?

(Sorry if my english is bad sometimes, by the way)

Regards,

Nicolas.

France. :whistle:

Link to comment
Share on other sites

Take alook at _IsPressed in the helpfile!

Hi,

Thanks for your help.

I had noticed this function but I can't quite figure out how I can chain the function to look after several keys in a particular order..

Say I want to monitor the three keys of my initial post, so "hw!" for example, and only if those keys are pressed, in this order, with no letters in between ("hawa!" must not react and trigger the same function), then it triggers a msgbox, how would you do that ? I tried things, but I can't make it work properly.

Thx,

Nicolas.

Link to comment
Share on other sites

Stop asking for a keylogger.

Hi Blue Drache,

Why are you saying that ?

Firstly, as I'm not a skilled programmer, I would not bother to develop a keylogger if I needed one, I would use one of the multiple free keyloggers that exist on the market !

Secondly, I am explicitly looking for specific input words, as my goal is to build this search and replace tool I'm talking about. I want it to look after what I'm typing, and when it sees a keyword of my choice, trigger a function right away... this has nothing to do with keylogging because to me, keylogging is looking for other people input data which I...don't know and I'm hoping to find out. What I'm doing is precisely the opposite : I want the program to look individually for the keys i'm pressing and react on a combination of my choice. What shocks you in that ?

Finally, to be more explicit, I can tell you exactly what I'm trying to do... I'm trying to reproduce the behavior of the Texter application (http://lifehacker.com/software/texter/lifehacker-code-texter-windows-238306.php). And why am I trying to do that ? Because today, Texter is absolutely not bug-free, and freezes many of my applications, which is not good; and also, it provides many functions that I don't need.

Is that enough justification ? I feel very sorry that I appear as one more looking-for-a-keylogger guy while I'm trying to develop something useful (at least for my own productivity if not for other people)

Regards,

Nicolas.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...