以编程方式触发快捷键即使对于Direct X也是如此 [英] Programmaticlly firing shortcut Keys Even for Direct X

查看:57
本文介绍了以编程方式触发快捷键即使对于Direct X也是如此的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我正在使用输入管理器DDL文件以编程方式触发命令,例如(因为我希望我的命令适用于DirectX以及我使用的是InputManager)

1. WindowKey

2. WindowKey + D

3. WindowKey + E

4. ALT + CTRL + DEL

5. WindowKey + C

6.窗口+。

但是我无法使用快捷键解雇它们

Hi I am using Input Manager DDL file to fire command programmatically such as( Since I want my Command to work for DirectX as well I am using InputManager )
1. WindowKey
2. WindowKey +D
3. WindowKey +E
4. ALT+CTRL+DEL
5. WindowKey + C
6. Window + .
But I could not fire them using shortcut key

Keys[] keys = new Keys[] { Keys.LWin, Keys.D };
InputManager.Keyboard.ShortcutKeys(keys); 




or by

private void BtnFireCmd_Click(object sender, EventArgs e)
        {
           // ExampleText.Focus(); //Sets focus on the example textbox

            Thread.Sleep(2000);
           // InputManager.Keyboard.KeyDown(Keys.Alt);
            InputManager.Keyboard.KeyDown(Keys.LWin);
            Thread.Sleep(2000);
            InputManager.Keyboard.KeyDown(Keys.C);

            Thread.Sleep(5000);
             InputManager.Keyboard.KeyUp(Keys.LWin);
            InputManager.Keyboard.KeyUp(Keys.Alt);


        }



我能否得到任何线索。

InputManager库 - 跟踪用户输入并模拟输入(鼠标和键盘)



即使是窗口键也没有被触发它正在按下但没有触发。



谢谢


Could I get any clue for that.
InputManager library - Track user input and simulate input (mouse and keyboard)

Even Window Key is not Firing It is getting press but not firing.

Thank You

推荐答案

我找到了解决方案,我正在调用错误的方法,实际方法是

InputManager.VirtualKeyboard.KeyDown(Keys.Win);

它工作得很好,但我仍然遇到Ctrl + Alt + tab和Alt + tab的问题

ALT + CTRL + DEL不会触发
I found Solution, I was calling wrong method, actual method is
InputManager.VirtualKeyboard.KeyDown(Keys.Win);
Its work well but I still has problem with Ctrl+Alt+tab and Alt+tab
ALT+CTRL+DEL does not fire


这篇关于以编程方式触发快捷键即使对于Direct X也是如此的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆