
So from LuaMacros version 0.1.1.9 released on July 12th 2017 there's new function lmc_send_input which is very flexible. It is answer to many requirements like unicode support, sending just key press (and release later) and so on. In fact this is just wrapper around windows function SendInput. It takes 3 numeric parameters
- virtual key code
- scan code
- flags
Simple scripts that waits 2 seconds and then sends ABc to active application is
Code: Select all
lmc_sleep(2000)
lmc_send_input(16, 0, 0) -- press shift
lmc_send_input(65, 0, 0) -- press A
lmc_send_input(65, 0, 2) -- release A
lmc_send_input(66, 0, 0) -- press B
lmc_send_input(66, 0, 2) -- release B
lmc_send_input(16, 0, 2) -- release shift
lmc_send_input(67, 0, 0) -- press C
lmc_send_input(67, 0, 2) -- release C