Ejemplo n.º 1
0
 internal static KeyboardInput.KeyUpDown GetSpecialKeyCode(bool specialKey, KeyboardInput.KeyUpDown key)
 {
     if (specialKey && ScanCodeDependent.Contains((KeyboardInput.SpecialKeys)key))
     {
         key |= KeyboardInput.KeyUpDown.KEYEVENTF_EXTENDEDKEY;
     }
     return(key);
 }
Ejemplo n.º 2
0
 private void SendKeyUp(short b, bool specialKey)
 {
     if (!keysHeld.Contains(b))
     {
         throw new InputDeviceException(string.Format("Cannot unpress the key {0}, it has not been pressed", b));
     }
     keysHeld.Remove(b);
     KeyboardInput.KeyUpDown keyUpDown = GetSpecialKeyCode(specialKey, KeyboardInput.KeyUpDown.KEYEVENTF_KEYUP, b);
     SendInput(GetInputFor(b, keyUpDown));
 }
Ejemplo n.º 3
0
 private void SendKeyDown(short b, bool specialKey)
 {
     if (keysHeld.Contains(b))
     {
         throw new InputDeviceException(string.Format("Cannot press the key {0} as its already pressed", b));
     }
     keysHeld.Add(b);
     KeyboardInput.KeyUpDown keyUpDown = GetSpecialKeyCode(specialKey, KeyboardInput.KeyUpDown.KEYEVENTF_KEYDOWN);
     SendInput(GetInputFor(b, keyUpDown));
 }
Ejemplo n.º 4
0
 private static Input GetInputFor(short character, KeyboardInput.KeyUpDown keyUpOrDown)
 {
     return(InputFactory.Keyboard(new KeyboardInput(character, keyUpOrDown, GetMessageExtraInfo())));
 }
Ejemplo n.º 5
0
 private void SendKeyDown(short b, bool specialKey)
 {
     keysHeld.Add(b);
     KeyboardInput.KeyUpDown keyUpDown = GetSpecialKeyCode(specialKey, KeyboardInput.KeyUpDown.KEYEVENTF_KEYDOWN);
     SendInput(GetInputFor(b, keyUpDown));
 }