rellik88 Posted June 12, 2005 Share Posted June 12, 2005 Question, i want to write a little bind key program my problem is how to recognize if a certain key is pressed... anyone got an idea on how to do this, just need the recognizing key command thx ;recognize keystroke here ;this is where it enters the text Send("{ENTER}") Send(enter text here) Send("{ENTER}") Link to comment Share on other sites More sharing options...
Valuater Posted June 12, 2005 Share Posted June 12, 2005 (edited) Question, i want to write a little bind key program my problem is how to recognize if a certain key is pressed... anyone got an idea on how to do this, just need the recognizing key command thx;recognize keystroke here;this is where it enters the textSend("{ENTER}")Send(enter text here)Send("{ENTER}")<{POST_SNAPBACK}>bind key programs can use_ispressed() ... or _ifispressed()this is a special function you will have to search the archices forIF I RUN IN TO IT I WILL POST IT HERE LATERgood luck 8)Found it herehttp://www.autoitscript.com/forum/index.ph...l=_IsPressed()# Edited June 12, 2005 by Valuater Link to comment Share on other sites More sharing options...
w0uter Posted June 12, 2005 Share Posted June 12, 2005 hotkeyset would work for his purpouse and is much easyer. My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
rellik88 Posted June 13, 2005 Author Share Posted June 13, 2005 (edited) how would this hotkeyset work ? ill try the other method mentioned above and researc the "hotkeyset" command but let me know... thx EDIT1: Hmm i tried the first methode with the shex key but i couldnt figure it out i think some advanced skills are needed which i dont posess ima check in on this hotkeyset thx guys EDIT2: Alright i tried the hotkeyset which seems to work for me now which is cool thx for that now atleast when i press a numberbutton it presses enter and gets ready to type stuff... the problem is it then doesnt type any thing?!? check my code and tell me whats wrong ;notice when button pressed HotKeySet("{NUMPAD1}", "testenter") While 1 Sleep(1) WEnd ;pressing enter to type text Func testenter() Send("{ENTER}") Send("testing") Send("{ENTER}") Endfunc thx Edited June 13, 2005 by rellik88 Link to comment Share on other sites More sharing options...
herewasplato Posted June 13, 2005 Share Posted June 13, 2005 ;notice when button pressed HotKeySet("{NUMPAD1}", "testenter") While 1 Sleep(1) WEnd ;pressing enter to type text Func testenter() WinActivate("Untitled - Notepad");<<<<<<<<<< WinWaitActive("Untitled - Notepad");<<<<<<<<<< Send("{ENTER}") Send("testing") Send("{ENTER}") EndfuncWhen testing your scripts, you might want to send the info to a specific window... one that is simple and ready to accept what you send to it. Start the code above Start Notepad Press numpad1 This might be what is happening to you with your original code: Your script sends "Enter" to some application to get it ready to accept text The application is getting ready...... Your script sends "testing" ... but your application is not ready to accept it yet Your script sends "Enter" ... but your application is not ready to accept it yet Your application is now ready to accept the text... bummer. You might have to add a sleep statement between those two lines of code or find another way to know that the application is ready to take the text. Either way, you might want to call the window into focus before sending keys to it. [size="1"][font="Arial"].[u].[/u][/font][/size] 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