spuuunit Posted July 2, 2014 Share Posted July 2, 2014 I want to do a script that works like this: As long as I'm holding down my C button on my keyboard, I want the SPACE button to be held down too. When I later release the C button on my keyboard, I want the SPACE button to be released too. How can I do a script like this? Link to comment Share on other sites More sharing options...
czardas Posted July 2, 2014 Share Posted July 2, 2014 I'm not sure if this is possible. You can remap the keyboard, so C becomes space. I don't know how to code for that, but there are keyboard remapping programs available. operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
spuuunit Posted July 2, 2014 Author Share Posted July 2, 2014 Well, then you have to restart your whole computer for that to work... Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted July 2, 2014 Moderators Share Posted July 2, 2014 Just curious, what are you trying to accomplish? There has to be a much easier way of accomplishing what you're after than spamming the Send function. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
czardas Posted July 2, 2014 Share Posted July 2, 2014 (edited) The problem, as I see it, is that the keys you want to use can only be sent separately - one at a time. It isn't like holding down the control, or alt key to combine with another key. If I am correct, then remapping may be the only solution. I haven't tested it and I could be wrong. You could try setting 'c' as a hotkey to call a function. It might work with some tweaks. It seems a strange thing to do though. Edited July 2, 2014 by czardas operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
jdelaney Posted July 2, 2014 Share Posted July 2, 2014 (edited) I can't remember the function that disables the keyboard and mouse intput, but you can probably use that, with a _IsPressed loop to do what you require...(then just send "C " in a loop)...I'd add a timer limit to it, to make sure you can become responsive again, while testing. Edited July 2, 2014 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
spuuunit Posted July 2, 2014 Author Share Posted July 2, 2014 thi I can't remember the function that disables the keyboard and mouse intput, but you can probably use that, with a _IsPressed loop to do what you require...(then just send "C " in a loop)...I'd add a timer limit to it, to make sure you can become responsive again, while testing. Hmmm, I'll test that out. Link to comment Share on other sites More sharing options...
czardas Posted July 2, 2014 Share Posted July 2, 2014 (edited) Okay I was wrong. ; #include <Misc.au3> HotKeySet("c", "space") HotKeySet("{ESC}", "quit") Global $dll = DllOpen("user32.dll") While 1 Sleep(10) WEnd Func space() While _IsPressed("43") Send("{SPACE}") WEnd EndFunc Func quit() DllClose($dll) Exit EndFunc ; If you want to make it less sensitive, add a sleep value to the function - after Send(). Edited July 2, 2014 by czardas operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
spuuunit Posted July 2, 2014 Author Share Posted July 2, 2014 Okay I was wrong. ; #include <Misc.au3> HotKeySet("c", "space") HotKeySet("{ESC}", "quit") Global $dll = DllOpen("user32.dll") While 1 Sleep(10) WEnd Func space() While _IsPressed("43") Send("{SPACE}") WEnd EndFunc Func quit() DllClose($dll) Exit EndFunc ; If you want to make it less sensitive, add a sleep value to the function - after Send(). Thanks =). 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