private async void KeyHook_KeyUp(KeyboardHook.VKeys key) { // Console.WriteLine(key); if (key != KeyboardHook.VKeys.ESCAPE) { releasedKeys.Clear(); return; } releasedKeys.Add(key); if (releasedKeys.Count > 2) { releasedKeys.Clear(); INPUT[] sequence = { User32Util.MakeInput(KeyCode.ALT, false), User32Util.MakeInput(KeyCode.F4, false), User32Util.MakeInput(KeyCode.F4, true), User32Util.MakeInput(KeyCode.ALT, true) }; User32Util.SendInputSequence(sequence); } await Task.CompletedTask; }
private void ArrangeWindows() { INPUT[] sequence = { User32Util.MakeInput(KeyCode.LWIN, false), User32Util.MakeInput(KeyCode.TAB, false), User32Util.MakeInput(KeyCode.TAB, true), User32Util.MakeInput(KeyCode.LWIN, true) }; User32Util.SendInputSequence(sequence); }
public void ShowDesktop() { INPUT[] sequence = { User32Util.MakeInput(KeyCode.LWIN, false), User32Util.MakeInput(KeyCode.KEY_D, false), User32Util.MakeInput(KeyCode.KEY_D, true), User32Util.MakeInput(KeyCode.LWIN, true) }; User32Util.SendInputSequence(sequence); }