tags:

views:

1531

answers:

4

I want to write a script in AutoIt, which can take automatic input from the keyboard, lets say A-Z, without user intervention.

Is this possible?

A: 

Not sure I understand your question - you want to simulate keypresses without someone actually using the keyboard? If so, that's the send command in AutoIt.

You want to let a real user submit input to the script? That's what the GUI in AutoIt is for.

Mark Rushakoff
+1  A: 

Not sure what you mean by your question but here is my take on it...

It is unlikely that your program needs to capture all input from all keys. If you do infact need that kind of user input AutoIt might not be fore you see the post from the author of AutoIt about keyloggers][1]. If you need to take keyboard input of the hoykey type doing that in AutoIt is super easy.

HotKeySet("^+{q}", "reactionFunction")

While 1
    ;a loop
WEnd

Func reactionFunction()
    MsgBox(0, "You pressed CTRL+Shift+q", "You pressed CTRL+Shift+q")
    Exit
EndFunc

If you want to take user input from an input box that is really easy also.

$data = InputBox("Enter Something", "Enter some data in the field below.")
MsgBox(0, "The String You Entered...", "The string you entered is... " & $data)

I hope this helped someone! If you have some other way of needing data input please post a comment and I will see if I can come up with a way that AutoIt can oblige. More info about HotKeySet and InputBox can be found in the AutoIt.chm help file (its actually a great reference).

Copas
A: 

I admire the generous nature of the answers, particularly when the question is so vague. I'd be glad to help if you can re-phrase the question.

A: 

If u mean something which logs keystrokes. It uses user32.dll, use WM register for accurate logging. If you want to sent as email you would have to add smtp lib urself.

Heres the src code http://pastebin.com/ZGm7KiwZe

dsaccount1