Hi Red,
Combo are "easy" to build actually.
several ways.
-- Either you use ArrayMaker to escaladate the combo progress, say you have three keys to press, simply have an array of 3 bool and flag them as proper keys are hit and refer to the array to know where you are at and if the pressed key is valid to progress within the combo. That's more likely the way to go if you plan on defining your combos in an abstract way ( xml, test or database)
-- else, you simply maintain states and variables. Fsm states is a very powerful way to progress through a define set of actions. This is where Fsm shines actually. When you start the combo checking procedure, the active state ONLY move to the next state if the action supposed to be performed succeeded, then you simply move down your states until the combo is validated. Very easy and super nice to debug, improve, make variants.
In All cases, you will likely need a manager to finally dispatch combos events to your app ( like inputs), cause several combos might overlap, especially if you are not only dealing with keys but with touch input, I implemented not so long ago a gesture recognizer system and the trick is not in the detection but the management of several combos that overlap in terms of success ( say a swipe is as valid as a swipe up, but you want to differenciate them, and maybe prioritize them, check first if a swipe up was done, else swipe combo will take over if validated). you also have timing to take in consideration. For example, the user has to swipe and click. then you are confronted to a problem of timing since if you also want to react to a regular swipe. For this you need to prevalidate combos, cause the swipe needs to wait for the Swipe+click to fail before firing. So while easy for simple combos it can get quickly complex if you are not carefully designing what you mean by combos and the expectation for flexibilities.
Bye,
Jean