Example #1
0
        public override string ToString()
        {
            var text = "";

            HotKeys.ForEach(key =>
            {
                switch (key)
                {
                case Key.LeftCtrl:
                case Key.RightCtrl:
                    text = "ctrl" + (text != "" ? $" + {text}" : "");
                    break;

                case Key.LeftAlt:
                case Key.RightAlt:
                case Key.System:
                    text = "alt" + (text != "" ? $" + {text}" : "");
                    break;

                case Key.LeftShift:
                case Key.RightShift:
                    text = "shift" + (text != "" ? $" + {text}" : "");
                    break;

                default:
                    text = text + (text != "" ? $" + " : "") + key.ToString().ToLower();
                    break;
                }
            });
            return(text);
        }
Example #2
0
 public void BroadcastUp()
 {
     HotKeys.ForEach(key =>
     {
         if (key == Key.System)
         {
             simulator.Keyboard.KeyUp(VirtualKeyCode.LMENU);
         }
         else
         {
             var virtualKeyCode = KeyInterop.VirtualKeyFromKey(key);
             simulator.Keyboard.KeyUp((VirtualKeyCode)virtualKeyCode);
         }
     });
 }