Jump to content

Recommended Posts

Posted

Dear community,

can you provide a newbee(me :mellow: ) 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.

Posted

How can i have the script run forever until manually terminated ?

The script provided exits immediately.

Rgds, Eirikur.

Posted

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.

Posted

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.

:mellow:

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

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
×
×
  • Create New...