I agree with the issue of events returning values, it seems to me. However, you can create a new CommandEventArgs class:
class CommandEventArgs : EventArgs { public DateTime GameTime {get; set; } public string Command {get; set;} public bool Valid {get; set;} }
then use an instance of this method to trigger the event, and then if the listener recognizes the command, set Valid to true. Therefore, if Valid is still false after the call, you know that the command was not recognized.
This is how .NET manages the keyboard events that you set KeyEventArgs.Handled to true to suppress any further actions that happen to the event.
James J. Regan IV
source share