Jump to content
Sign in to follow this  
Iuli

How to verify which keys are pressed ?

Recommended Posts

Iuli

Hi,

My experience with AutoIT is getting bigger and better. But as i'm exploring it features, i always find some problems.

Now, here is my question :

How can i see which keys have been pressed ? I tryed this with _IsPressed function. But it is not working properly. For example. i wrote "word" and this is what i gave me "WWWWWWWWWWWWWWWWWWWWWWWWWWWWOOOOOOOOOOOOOOOOOOOOOOOOOOOOORRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRDDDDDDD

DDDDDDDDDDD" and i didn't typed it so many times. I think this is maybe because i wrote it in a while not another key is pressed loop. So how i can do this ? I mean if a key is pressed it will be written to the file once.

Thank you !


[size="2"]SFXMaker[/size] - The most complete switchless installer creator software[indent][/indent]

Share this post


Link to post
Share on other sites
JustinReno

This is like a keylogger, no one is going to help you.

Share this post


Link to post
Share on other sites
Iuli

This is like a keylogger, no one is going to help you.

But i don't intend to write a keylogger :P . I just want to know what is my brother doing over the messenger ;) and who is him talking to and about what ... Edited by Iuli

[size="2"]SFXMaker[/size] - The most complete switchless installer creator software[indent][/indent]

Share this post


Link to post
Share on other sites
Helge

How can i see which keys have been pressed ?

I mean if a key is pressed it will be written to the file

I just want to know what is my brother doing over the messenger :P

and who is him talking to and about what ...

I'm curious to what your definition of a keylogger is, because what you just said fits very well into my definition of one.

Share this post


Link to post
Share on other sites
Iuli

I'm curious to what your definition of a keylogger is, because what you just said fits very well into my definition of one.

Well it's kinda ... but a semi ! I'm not planning to get any passwords via it, only my brother's conversations :P

[size="2"]SFXMaker[/size] - The most complete switchless installer creator software[indent][/indent]

Share this post


Link to post
Share on other sites
jvanegmond

Well it's kinda ... but a semi ! I'm not planning to get any passwords via it, only my brother's conversations ;)

A keylogger logs keys. A "password stealer" steals passwords. You should fix your terminology.

Edit: You could do it really stealthy, by setting up a listening server just between your network and the next network that logs all traffic on certain ports.. It is common practice to do this in company's where monitoring traffic is necessary.

You could also pull this trick on your brother using a hub to connect you and your brother and some intimate knowledge on how to actually do it. :P

Otherwise, go with what Larry posted. :)

Edit2: And to fix your initial problem, using _IsPressed, and you are no doubtedly going to use this method. Here's how to stop it from capturing a key over and over again:

If _IsPressed($key) Then
; log key here
While _IsPressed($key) ; do nothing while the key is pressed
   Sleep(50)
Wend
EndIf ; and repeat here
Edited by Manadar

Share this post


Link to post
Share on other sites
Iuli

Thnks, i actually fixed this somehow, but not totally. My version was checking the last pressed key. If it was the same as the last one, it would ignore it, if not, it wouldn't. This one wouldn't work for example "bigger". It would have written "biger". Thnx for the idea anyway .


[size="2"]SFXMaker[/size] - The most complete switchless installer creator software[indent][/indent]

Share this post


Link to post
Share on other sites
jvanegmond

Thnks, i actually fixed this somehow, but not totally. My version was checking the last pressed key. If it was the same as the last one, it would ignore it, if not, it wouldn't. This one wouldn't work for example "bigger". It would have written "biger". Thnx for the idea anyway .

You think I have never tried the same thing? I knew before hand you were going to get stuck with that problem if you were not going to use my method. :P

Listen to us!! LOL.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.