We use lua to script vehicles in a simulator.
The simulator has two control methods; the keyboard and a virtual cockpit controlled through the mouse.
... When you click a button in the virtual cockpit a value is changed and the lua script performs a set action.
You could also press a matching keyboard key to perform the same action which
There are a few instances though were there is not a scriptable equivalent for a keyboard keypress, which means in those circumstances a keyboard must always be used.