Hello Me You Posted March 1, 2007 Share Posted March 1, 2007 Is it possible to make to do this? Random Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 1, 2007 Moderators Share Posted March 1, 2007 Is it possible to make to do this? Of course Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
jvanegmond Posted March 1, 2007 Share Posted March 1, 2007 #include <Misc.au3> $dll = DllOpen("user32.dll") While 1 Sleep ( 250 ) If _IsPressed("23", $dll) Then MsgBox(0,"_IsPressed", "End Key Pressed") ExitLoop EndIf WEnd DllClose($dll) github.com/jvanegmond Link to comment Share on other sites More sharing options...
xcal Posted March 1, 2007 Share Posted March 1, 2007 #include <Misc.au3> $dll = DllOpen("user32.dll") While 1 Sleep ( 250 ) If _IsPressed("23", $dll) Then MsgBox(0,"_IsPressed", "End Key Pressed") ExitLoop EndIf WEnd DllClose($dll) Ya... that's what he was looking for... How To Ask Questions The Smart Way Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 1, 2007 Moderators Share Posted March 1, 2007 Ya... that's what he was looking for...Guess it was really hard to find (Considering that's the exact copy of the example in the help file ) Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
xcal Posted March 1, 2007 Share Posted March 1, 2007 (edited) I'm being sarcastic. It's pretty obvious what he's looking for, and that wasn't it. Edited March 1, 2007 by xcal How To Ask Questions The Smart Way Link to comment Share on other sites More sharing options...
Hello Me You Posted March 8, 2007 Author Share Posted March 8, 2007 I still can't find it.... Any suggestions? Random Link to comment Share on other sites More sharing options...
xcal Posted March 8, 2007 Share Posted March 8, 2007 You can't find the "any key?" How To Ask Questions The Smart Way Link to comment Share on other sites More sharing options...
Bert Posted March 8, 2007 Share Posted March 8, 2007 ummm....where is the "any key" on the keyboard? That is what you are asking..right? Otherwise....are you asking for when whatever key is pressed, you get a report on that key? If the later is what you want, what you are asking for is a keylogger. and that is a The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
therks Posted March 8, 2007 Share Posted March 8, 2007 Maybe he's just looking to check for keyboard input to end a screensaver or something like that, just to test for idle time? If that's the case I'm currently using something like this in a screensaver I made: Dim $i_LastActive = _LastActive() While 1 If $i_LastActive <> _LastActive() Then ExitLoop Sleep(100) WEnd Func _LastActive($v_User32Dll = 'user32.dll') Local $str_LastInput = DllStructCreate('uint;dword') DllStructSetData($str_LastInput, 1, DllStructGetSize($str_LastInput)) DllCall($v_User32Dll, 'int', 'GetLastInputInfo', 'ptr', DllStructGetPtr($str_LastInput)) Return DllStructGetData($str_LastInput, 2) EndFunc This is a modified version of a function that Gary once wrote. I don't have the original anymore though. My AutoIt Stuff | My Github Link to comment Share on other sites More sharing options...
magician13134 Posted March 8, 2007 Share Posted March 8, 2007 Another simple way to to just use a for loop, like For $i = 1 to 100 If _IsPressed(hex($i)) Then MsgBox(0, "Something", "Something else" Next You may need to strip the hex string of the 0x... Visit Magic Soft Inc. for some of my software Link to comment Share on other sites More sharing options...
Hello Me You Posted March 8, 2007 Author Share Posted March 8, 2007 You can't find the "any key?"ummm....where is the "any key" on the keyboard? That is what you are asking..right? Otherwise....are you asking for when whatever key is pressed, you get a report on that key? If the later is what you want, what you are asking for is a keylogger. and that is a I want if ANY key ("a" or "b" or "c" or "d" or "e" or other keys...) do something Random Link to comment Share on other sites More sharing options...
nitekram Posted March 8, 2007 Share Posted March 8, 2007 I want if ANY key ("a" or "b" or "c" or "d" or "e" or other keys...) do somethingYou are not going to get help like that - what you are asking for is a keylogger, look it up via search and you will see why. 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator Link to comment Share on other sites More sharing options...
BrettF Posted March 8, 2007 Share Posted March 8, 2007 You are not going to get help like that - what you are asking for is a keylogger, look it up via search and you will see why.What about the ocasional program that says "Press any key to Continue"?? Where did he say he wanted to log the key that was pressed? All i can see he wants is If any key (a, b, c, d, e, f, g...) was press, do something. I will admit it looks slightly suss though..... Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
magician13134 Posted March 9, 2007 Share Posted March 9, 2007 (edited) I think you guys need to stop being so suspicious, if he wanted a keylogger, he would just download one, not write it! And besides, who cares if he does want to write one, that's his choice! #Include <misc.au3> While 1 GUIGetMsg() For $i = 1 to 94 If _IsPressed(Hex($i)) Then MsgBox(0, "Key press!", "You pressed key number: " & $i) Next WEnd Hope that's what you wanted Edited March 9, 2007 by magician13134 Visit Magic Soft Inc. for some of my software Link to comment Share on other sites More sharing options...
amel27 Posted March 9, 2007 Share Posted March 9, 2007 Maybe he's just looking to check for keyboard input to end a screensaver or something like that, just to test for idle time? If that's the case I'm currently using something like this in a screensaver I madeHm-m... may be my edition with tow functions more flexible for screensavers:expandcollapse popup#include <Date.au3> $IdleMinimum = 5000 ; Minimum inactivity in seconds While 1 $iIdle = _IdleWaitStart ($IdleMinimum) ConsoleWrite (_Now () & ' ' & @UserName & ' already inactive ' & _TickToTimeString ($iIdle) & @CRLF) $iIdle = _IdleWaitCommit($IdleMinimum) ConsoleWrite (_Now () & ' ' & @UserName & ' inactivity amounts to ' & _TickToTimeString ($iIdle) & @CRLF) Wend Func _TickToTimeString ($iTicks) Local $iHours, $iMins, $iSecs, $sText = '' _TicksToTime ($iTicks, $iHours, $iMins, $iSecs) If $iHours Then $sText = $iHours & ' hours ' If $iMins Then $sText = $sText & $iMins & ' minutes ' If $iSecs Then $sText = $sText & $iSecs & ' seconds' If $sText = '' Then $sText = 'less than second' Return $sText EndFunc ; Wait for starting user inactivity ; Return inactivity time in milliseconds ; $idlesec - minimum inactivity period in milliseconds Func _IdleWaitStart ($idlesec) Local $aRet, $iSave, $iTick, $LastInputInfo = DllStructCreate ("uint;dword") DllStructSetData ($LastInputInfo, 1, DllStructGetSize ($LastInputInfo)) DllCall ("user32.dll", "int", "GetLastInputInfo", "ptr", DllStructGetPtr ($LastInputInfo)) Do Sleep(200) $iSave= DllStructGetData ($LastInputInfo, 2) DllCall ("user32.dll", "int", "GetLastInputInfo", "ptr", DllStructGetPtr ($LastInputInfo)) $aRet = DllCall ("kernel32.dll", "long", "GetTickCount") Until ($aRet[0] - DllStructGetData ($LastInputInfo, 2))> $idlesec Return $aRet[0] - DllStructGetData ($LastInputInfo, 2) EndFunc ; Wait for ending user inactivity ; Return inactivity time in milliseconds ; $idlesec - minimum inactivity period in milliseconds Func _IdleWaitCommit ($idlesec) Local $iSave, $LastInputInfo = DllStructCreate ("uint;dword") DllStructSetData ($LastInputInfo, 1, DllStructGetSize ($LastInputInfo)) DllCall ("user32.dll", "int", "GetLastInputInfo", "ptr", DllStructGetPtr ($LastInputInfo)) Do $iSave = DllStructGetData ($LastInputInfo, 2) Sleep(200) DllCall ("user32.dll", "int", "GetLastInputInfo", "ptr", DllStructGetPtr ($LastInputInfo)) Until (DllStructGetData ($LastInputInfo, 2)-$iSave) > $idlesec Return DllStructGetData ($LastInputInfo, 2)-$iSave EndFunc Link to comment Share on other sites More sharing options...
therks Posted March 9, 2007 Share Posted March 9, 2007 And besides, who cares if he does want to write one, that's his choice!It may be his choice, but he won't get help on how to make it here.http://www.autoitscript.com/forum/index.php?showtopic=14632 My AutoIt Stuff | My Github Link to comment Share on other sites More sharing options...
Vindicator209 Posted March 9, 2007 Share Posted March 9, 2007 of course noone cares if he makes a keylogger, it just makes AutoIt look bad...lol [center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center] Link to comment Share on other sites More sharing options...
Hello Me You Posted March 9, 2007 Author Share Posted March 9, 2007 I think you guys need to stop being so suspicious, if he wanted a keylogger, he would just download one, not write it! And besides, who cares if he does want to write one, that's his choice!#Include <misc.au3>While 1 GUIGetMsg() For $i = 1 to 94 If _IsPressed(Hex($i)) Then MsgBox(0, "Key press!", "You pressed key number: " & $i) NextWEndHope that's what you wantedYes, thanks! That was exactly what I wanted. Random Link to comment Share on other sites More sharing options...
Bert Posted March 9, 2007 Share Posted March 9, 2007 could you explain what you plan to do with this? The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now