public static void SendButtonCombination(ButtonSCS button, char key) { if (!keyMap.ContainsKey(key)) { return; } var btnDown = new INPUT(1, (ScanCodeShort)button, KEYEVENTF.SCANCODE); var keyWithBtn = new INPUT(1, keyMap[key], KEYEVENTF.SCANCODE); var btnUp = new INPUT(1, (ScanCodeShort)button, KEYEVENTF.KEYUP | KEYEVENTF.SCANCODE); Send(btnDown); Thread.Sleep(20); SendKey(key); Thread.Sleep(20); Send(btnUp); }
public static void SendButton(ButtonSCS btn) { Send(new INPUT(1, (ScanCodeShort)btn, KEYEVENTF.SCANCODE)); Thread.Sleep(20); Send(new INPUT(1, (ScanCodeShort)btn, KEYEVENTF.SCANCODE | KEYEVENTF.KEYUP)); }