Пример #1
0
        protected override bool ExecuteCommand(Event evt, WindowState state)
        {
            if (state.IsCurrentEditingASequencerTextField())
            {
                return(false);
            }

            if (evt.commandName == EventCommandNames.SelectAll)
            {
                TimelineAction.Invoke <SelectAllAction>(state);
                return(true);
            }

            if (evt.commandName == EventCommandNames.SoftDelete)
            {
                TimelineAction.Invoke <DeleteAction>(state);
                return(true);
            }

            if (evt.commandName == EventCommandNames.FrameSelected)
            {
                TimelineAction.Invoke <FrameSelectedAction>(state);
                return(true);
            }

            return(TimelineAction.HandleShortcut(state, evt));
        }
Пример #2
0
 internal void TreeViewKeyboardCallback()
 {
     if (Event.current.type != EventType.KeyDown)
     {
         return;
     }
     if (TimelineAction.HandleShortcut(state, Event.current))
     {
         Event.current.Use();
     }
 }
Пример #3
0
 public override void Init(IControl parent)
 {
     parent.KeyDown += delegate(object target, Event evt, TimelineWindow.TimelineState state)
     {
         bool result;
         if (state.IsCurrentEditingASequencerTextField())
         {
             result = base.IgnoreEvent();
         }
         else
         {
             result = TimelineAction.HandleShortcut(state, evt);
         }
         return(result);
     };
     parent.ValidateCommand += ((object target, Event evt, TimelineWindow.TimelineState state) => evt.get_commandName() == "Copy" || evt.get_commandName() == "Paste" || evt.get_commandName() == "Duplicate" || evt.get_commandName() == "SelectAll");
     parent.ExecuteCommand  += delegate(object target, Event evt, TimelineWindow.TimelineState state)
     {
         bool result;
         if (evt.get_commandName() == "Copy")
         {
             TimelineAction.InvokeByName("CopyAction", state);
             result = base.ConsumeEvent();
         }
         else if (evt.get_commandName() == "Paste")
         {
             TimelineAction.InvokeByName("PasteAction", state);
             result = base.ConsumeEvent();
         }
         else if (evt.get_commandName() == "Duplicate")
         {
             TimelineAction.InvokeByName("DuplicateAction", state);
             result = base.ConsumeEvent();
         }
         else if (evt.get_commandName() == "SelectAll")
         {
             TimelineAction.InvokeByName("SelectAllAction", state);
             result = base.ConsumeEvent();
         }
         else
         {
             result = base.IgnoreEvent();
         }
         return(result);
     };
 }