Lessons:L1L2L3Next »

You may have noticed that the listeners in the examples above don't get passed any parameters that tell them which controllers or which buttons they are listening to. Of course, you could create a unique class of listener for every button on every controller, but that's likely going to lead to repeating yourself and, in any case, would often be tedious. Have a look at this example of how you can write a single listener class that can tell at run-time which controller and which button it responds to.

Lessons:L1L2L3Next »