예제 #1
0
        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;
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }