Srvjj Posted January 21, 2011 Share Posted January 21, 2011 My problem is that I tried to use hotkeyset in a script where the hotkey can be spammed and not interrupt the function that the hotkey calls. Essentially I want to know if there is a way to make a function ignore hotkeys until its done executing its code. I looked around and found some replacement hotkey functions written by "Yashied" that seemed from the description to be able to do that but I tried it and wasn't able to use it as I intended. Also I herd there was such a thing as a "blocking" function that essentially did what I wanted but I couldnt find any material on how that would be applied. Link to comment Share on other sites More sharing options...
somdcomputerguy Posted January 21, 2011 Share Posted January 21, 2011 (edited) I'd disable any/all the hotkeys either before the function is called or make it the first thing the function does, then re-enable/reset them when the function returns or make it the last thing the function does.nevermind, I went and reread your post.. Edited January 21, 2011 by somdcomputerguy - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
Ace08 Posted January 21, 2011 Share Posted January 21, 2011 uhm how about turning the hotkey off when a function is running? you ca do this by just setting HotKeySet("KEY") Work smarter not harder.My First Posted Script: DataBase Link to comment Share on other sites More sharing options...
Srvjj Posted January 22, 2011 Author Share Posted January 22, 2011 (edited) uhm how about turning the hotkey off when a function is running?you ca do this by just setting HotKeySet("KEY")Thanks it turned off the hot key successfully but now I haven't had any luck turning it back on, i tried putting in a while loop a check to see if the key needed to be reset and if so reset it but it didn't work. I need to be able to spam a key which will do some stuff and ignore hot keys while its doing stuff then turn the hot key back on so that it can be pressed again. Th code goes something like thishotkeyset("{tab}", "FuncA")FuncA() hotkeyset("{tab}") send some keys wait a little while send a mouse click $okayresethotkey = 1endfuncwhile 1 if $okayresethotkey == 1 hotkeyset("{tab}", "FuncA") $okayresethotkey = 0 endifwend Edited January 22, 2011 by Srvjj Link to comment Share on other sites More sharing options...
somdcomputerguy Posted January 22, 2011 Share Posted January 22, 2011 (edited) HotKeySet("{TAB}", "FuncA") While 1 Sleep(10) WEnd Func FuncA() HotKeySet("{TAB}") send some keys ; use the Send() function here wait a little while ; use the Sleep() function here send a mouse click ; use the MouseClick() function here HotKeySet("{TAB}", "FuncA") EndFunc Edited January 22, 2011 by somdcomputerguy - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
Srvjj Posted January 22, 2011 Author Share Posted January 22, 2011 HotKeySet("{TAB}", "FuncA") While 1 Sleep(10) WEnd Func FuncA() HotKeySet("{TAB}") send some keys ; use the Send() function here wait a little while ; use the Sleep() function here send a mouse click ; use the MouseClick() function here HotKeySet("{TAB}", "FuncA") EndFunc Awesome it worked like that, I was skeptical of it working like that because I tried to use Blockinput and Yashied's _hotkeyrelease at the beginning and end of the code like that and neither worked. Link to comment Share on other sites More sharing options...
somdcomputerguy Posted January 22, 2011 Share Posted January 22, 2011 Glad to help you along. Guess I didn't mis-read your first post.. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. 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