Simulate input (DEF-3324)

Hi!

I’m considering to add gamepad support to my game and one challenge I’m facing is simulating a gamepad-driven mouse cursor (Pyre, for example, has that). I would have to heavily rewrite input handling code for all of my game objects in such a way that it responds both to real mouse events and simulated cursor events (and keep track of the input stack).

I think a useful feature would be to be able to emit simulated input events from Lua that obey all the rules real input events do (they are input-stack aware and you get them in on_input).

input.emit_action(action_id, action)

Apart from software cursors, this would also be great for recording user input during play testing sessions and playing it back.

11 Likes

Thank you for the suggestions. Being able to generate input events actually has more use cases. One that comes to mind is when doing BDD testing where you want to simulate user interaction to test your system.

Created DEF-3324 to investigate this. (low prio though so try to find a workaround)

6 Likes