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.