Skizmata Posted September 4, 2007 Share Posted September 4, 2007 $Toggle = True HotKeySet("e","example") Func example() If $Toggle Then Beep(500,10) $Toggle = Not $Toggle EndFunc While 1 Sleep(50) WEnd How would I change the example above to send the letter e when the beep does not fire. This is a simple example to show a problem I'm having in a project I'm working on to help me remap keys in a game. I would like the mapped keys to only be changed when in the game however I'm having a hard time. If the question/problem isn't clear let me know so I can restate it my English is lacking sometimes. *Note* I understand I could make it send("e") when it doesn't beep however this causes a looping problem. Thanks, -Skizmata AutoIt changed my life. Link to comment Share on other sites More sharing options...
cdkid Posted September 4, 2007 Share Posted September 4, 2007 not sure how to detect if it didn't beep, but to send e just do this func example() hotkeyset("e") send("e") hotkeyset("e", "example") endfunc AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide! Link to comment Share on other sites More sharing options...
Skizmata Posted September 4, 2007 Author Share Posted September 4, 2007 (edited) I'm sorry as I said my English is sometimes hard to understand. It could be more simply put this way. Show me an example of code that sets a hotkey of e and sends the letter e without causing a hellish loop. I need to be able to send the actual keys some of the time and send something else the rest of the time. Thanks, Edited September 4, 2007 by Skizmata AutoIt changed my life. Link to comment Share on other sites More sharing options...
Siao Posted September 4, 2007 Share Posted September 4, 2007 (edited) Check this thread for example#367271 Edited September 4, 2007 by Siao "be smart, drink your wine" Link to comment Share on other sites More sharing options...
jvanegmond Posted September 4, 2007 Share Posted September 4, 2007 This part is from the helpfile: ; capture and pass along a keypress HotKeySet("{Esc}", "captureEsc") Func captureEsc() ; ... can do stuff here HotKeySet("{Esc}") Send("{Esc}") HotKeySet("{Esc}", "captureEsc") EndFunc github.com/jvanegmond Link to comment Share on other sites More sharing options...
Skizmata Posted September 4, 2007 Author Share Posted September 4, 2007 Thanks guys! Question answered very well. I apologize for not being able to find it in other threads. To get the right answer you need to know how to ask the right question I suppose. AutoIt changed my life. 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