LuaInput

20 August 2019 Link



Introduction

Lua Input is a Lua module written in C which allows Lua to capture and simulate mouse and keyboard events.

API

The following functions are available in LuaInput
  1. getMouse() - returns and X and Y coordinates of the current mouse cursor position
  2. setMouse(x,y) - sets the mouse cursor at the position (x,y). Returns true if successful otherwise nil and error message
  3. leftClick() - Does a left click at the current cursor position
  4. rightClick() - Does a right click at the current cursor position
  5. pressedKeys() - Returns a table with a sequence of the virtual key codes that are currently pressed
  6. setKeys(keyTable) - Presses or unpresses keys. The keycode should be the key and value if true then key is pressed, if false then key is unpressed. Returns true if successful otherwise nil and a error message.
  7. clock() - Returns a tick value which increments every micro second.

Limitations

Currently only works on windows