The next step in our journey is to add input handling. We have to create a file called
input_manager.lua; it will be in charge of listening to input events and will be queried by our game when needed. We will create it so that it will be usable with both mouse devices and touchscreens.
Generally speaking, all hosts are supposed to implement their own input schema. We won't see this in detail in this book, but so you understand where this comes from, take a look at the hosts that are shipped with Moai SDK.
Search for all the references to the
AKUSetInputDevice* method calls in
We'll now inspect only the most important methods; please take a look at the full code in order to understand ...