Jump to content

HotKeySet() Issue


Skizmata
 Share

Recommended Posts

$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

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

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 by Skizmata

AutoIt changed my life.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...