private void KeyDownRemote(uint keyCode, uint modifiers) { if (KeyboardCallback == null) { return; } if (modifiers != 0) { if ((modifiers & (uint)KeyModifiers.LeftAlt) != 0) { KeyboardCallback(Name, (int)Keyboard.VKey.VK_LMENU, false); } if ((modifiers & (uint)KeyModifiers.LeftControl) != 0) { KeyboardCallback(Name, (int)Keyboard.VKey.VK_LCONTROL, false); } if ((modifiers & (uint)KeyModifiers.LeftShift) != 0) { KeyboardCallback(Name, (int)Keyboard.VKey.VK_LSHIFT, false); } if ((modifiers & (uint)KeyModifiers.LeftWin) != 0) { KeyboardCallback(Name, (int)Keyboard.VKey.VK_LWIN, false); } if ((modifiers & (uint)KeyModifiers.RightAlt) != 0) { KeyboardCallback(Name, (int)Keyboard.VKey.VK_RMENU, false); } if ((modifiers & (uint)KeyModifiers.RightControl) != 0) { KeyboardCallback(Name, (int)Keyboard.VKey.VK_RCONTROL, false); } if ((modifiers & (uint)KeyModifiers.RightShift) != 0) { KeyboardCallback(Name, (int)Keyboard.VKey.VK_RSHIFT, false); } if ((modifiers & (uint)KeyModifiers.RightWin) != 0) { KeyboardCallback(Name, (int)Keyboard.VKey.VK_RWIN, false); } } if (keyCode != 0) { Keyboard.VKey vKey = ConvertMceKeyCodeToVKey(keyCode); KeyboardCallback(Name, (int)vKey, false); } }
private void KeyDown(uint keyCode, uint modifiers) { if (modifiers != 0) { if ((modifiers & (uint)KeyModifiers.LeftAlt) != 0) { Keyboard.KeyDown(Keyboard.VKey.VK_LMENU); } if ((modifiers & (uint)KeyModifiers.LeftControl) != 0) { Keyboard.KeyDown(Keyboard.VKey.VK_LCONTROL); } if ((modifiers & (uint)KeyModifiers.LeftShift) != 0) { Keyboard.KeyDown(Keyboard.VKey.VK_LSHIFT); } if ((modifiers & (uint)KeyModifiers.LeftWin) != 0) { Keyboard.KeyDown(Keyboard.VKey.VK_LWIN); } if ((modifiers & (uint)KeyModifiers.RightAlt) != 0) { Keyboard.KeyDown(Keyboard.VKey.VK_RMENU); } if ((modifiers & (uint)KeyModifiers.RightControl) != 0) { Keyboard.KeyDown(Keyboard.VKey.VK_RCONTROL); } if ((modifiers & (uint)KeyModifiers.RightShift) != 0) { Keyboard.KeyDown(Keyboard.VKey.VK_RSHIFT); } if ((modifiers & (uint)KeyModifiers.RightWin) != 0) { Keyboard.KeyDown(Keyboard.VKey.VK_RWIN); } } if (keyCode != 0) { Keyboard.VKey vKey = ConvertMceKeyCodeToVKey(keyCode); Keyboard.KeyDown(vKey); } }