esi Posted February 13, 2010 Share Posted February 13, 2010 Dear community, can you provide a newbee(me ) with a simple script which detects the hotkey : SPACE as input and sends CTRL+SPACE as output. The script should run forever until manually terminated. Rgds, Eirikur. Link to comment Share on other sites More sharing options...
somdcomputerguy Posted February 13, 2010 Share Posted February 13, 2010 This would be quite a simple script to create. Here are the functions needed. Read thru them and write out some code. If you have problems, post back here your code and any questions and you'll get some help I'm sure.HotKeySetSend - 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...
Pruttelpot Posted February 13, 2010 Share Posted February 13, 2010 Guess it should be something like: HotKeySet("{Space}", "captureSpace") Func captureSpace() Send("{CTRL]+{SPACE}") EndFunc Link to comment Share on other sites More sharing options...
PsaltyDS Posted February 13, 2010 Share Posted February 13, 2010 The Ctrl+{Space} key stroke is: "^{SPACE}" What you posted (with the square bracket corrected to a curly brace) would send CTRL, then send "+", then send "{SPACE}". Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
esi Posted February 13, 2010 Author Share Posted February 13, 2010 How can i have the script run forever until manually terminated ? The script provided exits immediately. Rgds, Eirikur. Link to comment Share on other sites More sharing options...
somdcomputerguy Posted February 13, 2010 Share Posted February 13, 2010 While 1 ;your script WEnd - 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...
esi Posted February 14, 2010 Author Share Posted February 14, 2010 Thanks for all the pointers. The final script looks like this : HotKeySet("{Space}", "captureSpace") While 1 WEnd Func captureSpace() Send("^{SPACE}") EndFunc (If I place the script between while and wend I get syntax error) A script to replace "x" with "y" which can be tested in a notepad document is as follows: HotKeySet("x", "capturetest") While 1 WEnd Func capturetest() Send("y") EndFunc Hopefully this sample can help someone else. Rgds, Eirikur. Link to comment Share on other sites More sharing options...
PsaltyDS Posted February 16, 2010 Share Posted February 16, 2010 Note what happens to your CPU usage (from Task Manager, Performance tab) while running that. You might want to put Sleep(10) inside that While/WEnd loop. I would also give yourself a way to kill it, like a HotKeySet() for "{ESC}" that just exits the script. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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