示例#1
0
 private bool CheckCommands(KeyCode key)
 {
     if (_cancelCommand != null && _cancelCommand.IsNewlyPressed())
     {
         _cancelCommand.BlockNextRelease();
         InvokeCancel();
         return(true);
     }
     if (_okCommand != null && _okCommand.IsNewlyPressed())
     {
         _okCommand.BlockNextRelease();
         InvokeOk();
         return(true);
     }
     if (_resetCommand != null && _resetCommand.IsNewlyPressed())
     {
         _resetCommand.BlockNextRelease();
         InvokeReset();
         return(true);
     }
     if (key == KeyCode.Mouse0 || key == KeyCode.Mouse1)
     {
         return(true);
     }
     return(false);
 }
示例#2
0
 protected virtual void OnOpenCommand(SingleAxisCommand command)
 {
     if (IsSelected && _openCommands.Contains(command))
     {
         command.ConsumeInput();
         command.BlockNextRelease();
         Open();
     }
 }