lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Tue, Sep 13, 2011 at 10:24, Gareth Jury <> wrote:

How do you simulate key presses in lua.??

And if you hold down a key while pressing another??

Lua doesn't have any native facilities for simulating a key press.  How you would do that depends on the operating system on which your Lua host application executes.

You would most likely have to build/buy/use a library/dll that stuffs the keyboard buffer with the desired key(s) press.  Chances are you will have to build  (in C/C++) an interface to this library/dll, register the functions in the interface with the Lua engine so they can be used in Lua.