Modifications for Saymon project: generate event for input, load state from input.