Esempio n. 1
0
 private void HotKeyManager_HotKeyPressed(object sender, HotKeyEventArgs e)
 {
     if (controlHotkeys.ContainsKey(e.Key))
     {
         ActionStashString stash = controlHotkeys[e.Key];
         if (stash._keyModifier == e.Modifiers && !stash._isInactive)
         {
             stash._action.Invoke(stash._data);
         }
         else if (stash._isInactive)
         {
             Console.WriteLine("This command in currently inaccessible");
         }
     }
     else if (voiceHotkeys.ContainsKey(e.Key))
     {
         ActionStashSpeechArgs stash = voiceHotkeys[e.Key];
         if (stash._keyModifier == e.Modifiers && !stash._isInactive)
         {
             stash._action.Invoke(stash._data);
         }
         else if (stash._isInactive)
         {
             Console.WriteLine("This command in currently inaccessible");
         }
     }
     else
     {
         Console.WriteLine("Hotkey for " + e.Key + " is not assigned");
     }
 }
Esempio n. 2
0
 public void SetInactive(Keys key, bool state)
 {
     if (controlHotkeys.ContainsKey(key))
     {
         ActionStashString stash = controlHotkeys[key];
         stash._isInactive   = state;
         controlHotkeys[key] = stash;
     }
     if (voiceHotkeys.ContainsKey(key))
     {
         ActionStashSpeechArgs stash = voiceHotkeys[key];
         stash._isInactive = state;
         voiceHotkeys[key] = stash;
     }
 }