Jump to content

hotkey type checks


Recommended Posts

hello, i have a function that i need to run when alt+shift+4 is pressed on the keyboard.

here is the function

Func button_4($user_id)
    $url        =    _HTTPEncodeString($var&"="&$user_id)
    $socket        =    _HTTPConnect($host)
    $post        =    _HTTPPost($host,$page,$socket,$url)
    $recv        =    _HTTPRead($socket,1)
EndFunc

the thing is, i need to put all that in another function and i need that function to wait for the hotkeys to be pressed and button_r function to finish processing before moving on.

Link to comment
Share on other sites

It may just be me - but I'm not positive that I understand your request.

If you need one func to complete before a user can ask to start a new one, then do not define the HotKeys until after the first func completes... Again - I might not even be close to what you want... but here is something for you to look and and say where it fails ya:

HotKeySet("!+r", "button_r")

While 1
    Sleep(9)
WEnd

Func button_r()
    ;do stuff here
    ;;
    ;;
    ;until the func finishes
    HotKeySet("!+4", "button_4")
EndFunc   ;==>button_r

Func button_4()
    ;do stuff here
    ;;
    ;;
    HotKeySet("!+4", "")
EndFunc   ;==>button_4

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

Will "HotKeySet" not work?

You have 2 methods of accomplishing this... 1 being...

HotkeySet("keys","Function")

HotkeySet("!+4","button_4") ; ! = Alt, + = Shift
Func button_4($user_id)
    $url        =    _HTTPEncodeString($var&"="&$user_id)
    $socket        =    _HTTPConnect($host)
    $post        =    _HTTPPost($host,$page,$socket,$url)
    $recv        =    _HTTPRead($socket,1)
EndFuncoÝ÷ Ù²,>·¬±çjºa{Ê«¨·öåµ8b²+'ßÛmêâpk+hvaÆî¶+l¶'£¢ëZºÚ"µÍÚ[ÛYH   ÓZØË]LÉÝÈÈZØÈ[ÛYHÈYYYÌÍÙHÜ[  ][ÝÝÙÌ  ][ÝÊHÈÛÈZXY[Ü[HÈ[ÝHÜX[ÙBÚ[HBYÒÔÜÙY
    ][ÝÌL][ÝË   ÌÍÙ
H[ÒÔÜÙY
    ][ÝÌL ][ÝË  ÌÍÙ
H[ÒÔÜÙY
    ][ÝÌÍ    ][ÝË  ÌÍÙ
H[ÙÐÞ
    ][ÝÕ]I][ÝË  ][ÝÐ[
ÈÚY
È
ÈY[ÜÙY][ÝÊB[YÑ[
Edited by BinaryBrother

SIGNATURE_0X800007D NOT FOUND

Link to comment
Share on other sites

I see what your saying, this may not be the right answer, but it works... ^_^

HotkeySet("!+4","button_4aaaa") ; ! = Alt, + = Shift

Func Button_4aaaa
     button4(45)
EndFunc
Func button_4($user_id)
    $url        =    _HTTPEncodeString($var&"="&$user_id)
    $socket        =    _HTTPConnect($host)
    $post        =    _HTTPPost($host,$page,$socket,$url)
    $recv        =    _HTTPRead($socket,1)
EndFunc

SIGNATURE_0X800007D NOT FOUND

Link to comment
Share on other sites

hmm, ya it works, however, 45 was just an example the function's input where 45 is at is suppose to have $id[2], and $id[2] is provided by the rest of the script...

maybe setting it as global?

*edit*

that didn't seem to work

Edited by seesoe
Link to comment
Share on other sites

hmm, ya it works, however, 45 was just an example the function's input where 45 is at is suppose to have $id[2], and $id[2] is provided by the rest of the script...

maybe setting it as global?

*edit*

that didn't seem to work

It will work if you do it right. ^_^

Without knowing what you've tried, what issue your getting with your code, or some more detailed insight, my advise in minimal.

SIGNATURE_0X800007D NOT FOUND

Link to comment
Share on other sites

the code is the whole program, it works as a whole i can't really cut some out and show you the part we are working on...

i have a program that accepts socket data and then when it finds specified types of data strings it phrases that, prints it, and writes to a database, the part that we are working on is the last part right after the database writing, where it looks for a key press and when it does it will send a signal to a server and then the server emails a confirmation email saying we got that data that was sent

the program is tied to a few other servers and things, i will do my best to recreate some simple workable code environment for everyone here to see and mess with.

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