private void canvas_KeyDown(object sender, KeyEventArgs e) { if (commands.ContainsKey(e.Key)) { command = commands[e.Key]; if (command.NumberKeys == 1) { command.Execute(e.Key); } } else { command.Execute(e.Key); ResetCommand(); } }
internal void ResetCommand() { command = commands[Key.Cancel]; }