Create an API, which will have two functions
Register -- which takes sequence of keys and register a special move, Like in a street fighter game UDLR(up, down, left, right) can be registered to special move "Fireball".
emit --takes a single key and returns the list of registered sequence(s) that were completed by key press
register("UDLR", "Fireball");
register("DLRU", "Punch");
register("LR", "Kick");
emit("U");
emit("D");
emit("L");
emit("R"); -- returns a list containing {"Fireball" and "kick"}
emit("U"); -- return a {"Punch"}
emit("U");
emit("U");
emit("U");---- returns a list containing {"Fireball" and "kick"