Exemple #1
0
 protected void RunCommand(T key, KeyBehavior behavior)
 {
     if (commands[behavior].ContainsKey(key))
     {
         commands[behavior][key].Execute();
     }
 }
Exemple #2
0
 public void AddCommand(object key, ICommand value, KeyBehavior behavior)
 {
     if (key is T castedKey)
     {
         commands[behavior].Add(castedKey, value);
     }
 }
Exemple #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>();
 }