Jump to content

Question about HotKeySet


corl455
 Share

Recommended Posts

Alright, so I'm creating a small program that I'm going to use to annoy people around me in school, all it will do is make the motherboard beep when you press the keyboard, but I'm going to set it up like a piano so you can play songs. So to get it to play something I have to use:

HotKeySet ( "q", "beep261")

Func beep261()
    beep(261,100)
endfnc

Is there any way to change that so all I have to do is something like:

HotKeySet ( "q", beep(261,100))

Mabey another function or something? I'm kind of new to autoit, but not to scripting.

Link to comment
Share on other sites

to annoy people? uhmmm... T_T

anyway...according to your code.. you will have over 260 functions.. and roughly 4 lines per function... and 200+ Hotkeysets...

200+200*4=1000 lines of code just for this simple project...there are a few other simpler ways to do it.. but hotkeyset probably would be the fastest way.. _ispressed will have to check individually for each key

Link to comment
Share on other sites

you can use an algorithm to get the HEX value of a key.. and place it in a loop... would be kinda laggy.. but it WOULD cut down on a hundred or two lines... then maybe call a function with parameters instead of making a hundred other functions...

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...