示例#1
0
 protected void RunCommand(T key, KeyBehavior behavior)
 {
     if (commands[behavior].ContainsKey(key))
     {
         commands[behavior][key].Execute();
     }
 }
示例#2
0
 public void AddCommand(object key, ICommand value, KeyBehavior behavior)
 {
     if (key is T castedKey)
     {
         commands[behavior].Add(castedKey, value);
     }
 }
示例#3
0
        public MainPage()
        {
            this.InitializeComponent();
            //ViewModel = (ViewModel.ViewModel)DataContext;
            //text.Paste += Text_Paste;
            //ViewModel.OnNavigatedTo(this, Frame);


            Key = new KeyBehavior(Content);
            Key.Add(new KeyAction(KeyAction.Ctrl + VirtualKey.S, e => Debug.Write("s")));
        }
 public void Awake()
 {
     rend        = GetComponent <SpriteRenderer>();
     keyBehavior = GetComponent <KeyBehavior>();
 }