Esempio n. 1
0
            public int push(string sequence)
            {
                int             charsToRemove           = 0;
                ModifierPressed modifierPressed         = new ModifierPressed();
                ModifierPressed previousModifierPressed = getModifiersPressed();

                while (charsToRemove < sequence.Length)
                {
                    if (sequence[charsToRemove] == '+' && previousModifierPressed.Shift)
                    {
                        modifierPressed.Shift = true;
                        keyboard.HoldKey(KeyboardInput.SpecialKeys.SHIFT);
                        charsToRemove++;
                    }
                    else if (sequence[charsToRemove] == '+' && previousModifierPressed.Ctrl)
                    {
                        modifierPressed.Ctrl = true;
                        keyboard.HoldKey(KeyboardInput.SpecialKeys.CONTROL);
                        charsToRemove++;
                    }
                    else if (sequence[charsToRemove] == '%' && previousModifierPressed.Alt)
                    {
                        modifierPressed.Alt = true;
                        keyboard.HoldKey(KeyboardInput.SpecialKeys.ALT);
                        charsToRemove++;
                    }
                    else
                    {
                        break;
                    }
                }

                modifierPressedStack.Push(modifierPressed);

                return(charsToRemove);
            }
Esempio n. 2
0
 public virtual void HoldKey(KeyboardInput.SpecialKeys key)
 {
     container.Focus();
     keyboard.HoldKey(key, container);
 }