seesoe Posted May 4, 2009 Share Posted May 4, 2009 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 More sharing options...
herewasplato Posted May 4, 2009 Share Posted May 4, 2009 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 More sharing options...
BinaryBrother Posted May 4, 2009 Share Posted May 4, 2009 (edited) 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 May 4, 2009 by BinaryBrother SIGNATURE_0X800007D NOT FOUND Link to comment Share on other sites More sharing options...
seesoe Posted May 5, 2009 Author Share Posted May 5, 2009 i would like to use HotkeySet("!+4","button_4") however, i need to run function button_4(45) not just button_4 Link to comment Share on other sites More sharing options...
BinaryBrother Posted May 5, 2009 Share Posted May 5, 2009 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 More sharing options...
seesoe Posted May 6, 2009 Author Share Posted May 6, 2009 (edited) 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 May 6, 2009 by seesoe Link to comment Share on other sites More sharing options...
herewasplato Posted May 6, 2009 Share Posted May 6, 2009 ... that didn't seem to workcan you post the code that did not work? [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
BinaryBrother Posted May 8, 2009 Share Posted May 8, 2009 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 More sharing options...
seesoe Posted May 8, 2009 Author Share Posted May 8, 2009 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 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